📌 Advanced Market Product Management Using Data Structures In Python (University Project – Data Structures Course)
📘 This project is an advanced product management system implemented in Python, designed for a university Data Structures course. The system manages market products and performs operations such as:
- Adding and deleting products
- Storing historical prices
- Calculating median prices
- Retrieving sorted prices
- Searching products by name or price
- Returning products inside specific price ranges
The project is fully implemented using custom Data Structures, including:
- Doubly Circular Linked List
- Binary Search Trees (BSTs)
- Custom List-to-Tree Conversions
These structures ensure efficient storage, search, insertion, deletion, and price analysis.
🎯 Features:
-
Product Management Add new product Add new price to an existing product Delete product
-
Price Analysis Compute median price via BST List products sorted by smallest price List products sorted by largest price Show all products within a price range
-
Searching Search product by name using BST Search product by exact price using BST
🧵 Data Structures Used
-
Doubly Circular Linked List Used for storing the list of prices for each product. Supports: Insert Delete Find Convert linked list to Python list Efficient traversal
-
Binary Search Tree (BST) Two separate BSTs are used:
(1) ProductBST (sorted by product name) That used for: Fast insertion Fast alphabetical search Fast deletion
(2) PriceBST (sorted by product price) Used for: Sorted output (smallest → biggest) Reverse sorted output Searching price Returning products in a price range
- Additional Structures Node class for Linked List TreeNode & BSTNode for trees
⚙️ How to Run You need Python 3.8+ and no external libraries needed. At first Clone this repository using this code: git clone https://github.com/AfroozBehrooznick/Advanced-Market-Product-Management-With-Data-Structures-Create-With-Python- Then run the program with: python main.py
📊 Median Calculation The median price is computed by: Converting the product’s linked list to a Python list Building a BST from the list Performing an inorder traversal to get sorted data Returning the median value
📑For more details ,You can read Market.pdt which is written in Persian.
🖋️ Built by "Afrooz behrooznick"