- To understand C programming language and its various applications. To also explore C's customizability and flexibility.
- To leverage data structures and algorithms for efficient data processing and storage.
gcc -o main main.c
./main
- Supports User Registration and Login
- Supports Product Information as Inventory Catalogue. Products can be added too.
- Browsing and Purchase History can be tracked
- Recommendation Engine to suggest personalized recommendations
-
main()
:- Initializes the hash table.
- Starts the main menu loop.
-
mainMenu()
:- Provides an interactive menu to navigate features like login, viewing products, and managing history.
-
User Functions:
addUser()
: Adds a new user to the hash table.getUserByID()
: Retrieves a user by their userID.userLogin()
: Validates user credentials and logs in the user.
-
Product Functions:
addProduct()
: Adds a new product to the hash table.getProductByName()
: Retrieves a product by name.displayProductsByCategory()
: Displays products in a specified category.
-
History Management:
recordBrowsingHistory()
: Adds a product to the user's browsing history.recordPurchaseHistory()
: Adds a product to the user's purchase history.
-
Recommendation Engine
- Products are linked using
addProductRelationship()
and thegenerateRecommendations()
function integrates these strategies to create a ranked list of recommended products for each user
- Products are linked using
- The program initializes a hash tables
USER_TABLE_SIZE
andPRODUCT_TABLE_SIZE
to store user and product data. - The
initHashTable()
function sets up the data structure.
- The
addUser()
andaddProduct()
functions allow adding users and products to the hash table - Users and Products are stored in the
users
array of the hash table andproducts
array withProductNode
structures respectively. - The Login System checks if the user is registered in the platform.
- Users can search for products by name or category using the
displayProduct()
anddisplayProductsByCategory()
functions.
- Browsing History: The program records products viewed by a user in their
browsingHistory
list. - Purchase History: The program records purchased products in the user's
purchaseHistory
list.
- Suggests products based on the user's purchase history.
The mainMenu()
function provides a command-line interface which includes a catalogue of options for the users to choose from.