A comprehensive Data Structures and Algorithms project featuring an interactive GUI application for building custom PCs with real-time compatibility checking and optimization algorithms.
PC Master Builder is an advanced educational project developed for the Data Structures and Algorithms course at the University of the Punjab (3rd Semester).
This application demonstrates real-world applications of DSA concepts through an interactive PC building simulator. It features:
- 🎨 GUI Application - Modern, user-friendly interface built with SFML for visual component selection
- ⚙️ Console Engine - Legacy text-based interface showcasing algorithmic approaches
- 🔗 Smart Compatibility System - Graph-based validation to prevent incompatible hardware combinations
- 📊 Optimization Algorithms - Greedy algorithms for budget-optimized builds
The dual-interface design allows comprehensive exploration of various data structures and algorithmic paradigms in a single, cohesive project.
The primary interface provides a modern, intuitive experience for building custom PCs:
- Browse and search components (CPU, GPU, RAM, SSD, PSU, Motherboard, etc.)
- Real-time price calculations and budget tracking
- Component specifications and detailed compatibility information
- Prevents selection of incompatible hardware combinations
- Validates CPU socket compatibility with motherboards
- Checks power supply adequacy for selected components
- Built on Graph data structure for flexible constraint modeling
- Visual representation of selected components
- Live total price and power consumption calculation
- Easy component swapping and removal
- Running totals and specification summary
- Stack-based navigation history
- Seamless back/forward functionality
- Persistent build state management
- User-friendly screen transitions
- Save custom PC configurations to disk
- Load previously saved builds
- Share build specifications with others
- Configuration persistence across sessions
The legacy console interface demonstrates advanced algorithmic concepts:
- Greedy algorithm implementation
- Priority queue-based cost optimization
- Automatically selects best components within budget constraints
- Trade-off analysis between performance and cost
- Queue-based step sequencing
- Topological ordering of assembly steps
- Dependency resolution for component installation
- Step-by-step assembly instructions
- N-ary tree structure for PC subsystem modeling
- Recursive power consumption calculation
- Performance metric aggregation
- System bottleneck identification
This project implements and showcases the following data structures:
| Data Structure | Implementation | Primary Use Case |
|---|---|---|
| Hash Table | std::unordered_map<string, Component> |
Part Catalog - O(1) component lookup by ID |
| Graph | Adjacency List (std::map) | Compatibility validation - constraint enforcement |
| Stack | std::stack<Screen*> |
GUI Navigation - screen history management |
| Dynamic Array | std::vector<T> |
Component lists, cart items, menu options |
| N-ary Tree | Custom tree structure | System hierarchy - subsystem composition |
| Priority Queue | Min-Heap std::priority_queue |
Budget optimization - component selection |
| Queue | FIFO Queue (std::queue) | Assembly guide - step-by-step sequencing |
| Operation | Data Structure | Time Complexity | Space Complexity | Rationale |
|---|---|---|---|---|
| Add Component | Hash Table | O(1) average | O(n) | Direct insertion with hash function |
| Check Compatibility | Graph | O(V + E) BFS/DFS | O(V) | Traversal of constraint edges |
| Navigate Back | Stack | O(1) pop | O(h) | Stack top removal |
| Find Best Build | Priority Queue | O(n log n) | O(n) | Heap operations during selection |
| Assembly Planning | Queue | O(n) | O(n) | Linear traversal of steps |
| Load Component | Hash Table | O(1) average | O(1) | Hash lookup |
| Component | Details |
|---|---|
| Language | C++17 (Modern C++ features, STL) |
| Build System | CMake 3.18+ (Cross-platform compilation) |
| Graphics Library | SFML 3.0.2 (Automatic dependency management via FetchContent) |
| Standard Library | STL containers (unordered_map, stack, queue, vector, priority_queue) |
| Design Patterns | OOP (Inheritance, Polymorphism), Factory, MVC |
| Memory Management | Smart pointers, RAII principles |
| Compiler Support | MSVC 2019+, GCC 9+, Clang 10+ |
- SFML 3.0.2 - Automatically downloaded and configured by CMake
- Standard C++ Library - No external dependencies beyond STL
- System Libraries - Windows (direct.h), Linux/Mac (unistd.h) for file operations
- C++ Compiler: MSVC (Visual Studio 2019+), GCC 9+, or Clang 10+
- CMake: Version 3.18 or higher
- Git: For cloning the repository
- Internet Connection: Required for first-time SFML library download
git clone https://github.com/M-Zaid-Git/PC_Maker.git
cd PC_Maker# Windows
mkdir build_clean
cd build_clean
# Linux/Mac
mkdir -p build_clean
cd build_clean# Windows (Visual Studio)
cmake .. -G "Visual Studio 16 2019" -A x64
# Linux/Mac (Unix Makefiles)
cmake ..# Windows
cmake --build . --config Release
# Linux/Mac
make -j$(nproc)# Windows
./Release/PCMasterBuilder.exe
# Linux/Mac
./PCMasterBuilder# Debug build with symbols for debugging
cmake .. -DCMAKE_BUILD_TYPE=Debug
# Release build optimized for performance
cmake .. -DCMAKE_BUILD_TYPE=Release
# Release build with debug symbols
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo-
Launch the Application
./PCMasterBuilder
-
Navigate Component Selection
- Use the main menu to browse component categories
- Select components from the interactive catalog
- System validates compatibility in real-time
-
Build Your PC
- Add components to your cart
- View live price and power consumption updates
- Review compatibility warnings before final selection
-
Review and Save
- Examine build summary and compatibility report
- Save configuration for future use
- Export build specification
Run the console version with advanced algorithmic features:
# Build and run console version
cmake --build . --target PCMasterBuilder_Console
./PCMasterBuilder_ConsoleFeatures:
- Enter your budget constraints
- Auto-generate optimal PC configuration
- View assembly instructions and component hierarchy
Application Flow:
├─ Launch → Main Menu
├─ Browse Components
│ ├─ CPU Selection → Intel i7-13700K
│ ├─ Motherboard → Compatible Z790 Board
│ ├─ GPU → NVIDIA RTX 4070
│ ├─ Memory → 32GB DDR5 RAM
│ ├─ Storage → 1TB NVMe SSD
│ └─ Power Supply → 850W 80+ Gold
├─ Compatibility Check ✓
├─ Review Build Summary
├─ Verify Power Budget
└─ Save Configuration
The project is organized as follows:
PC_Maker/
│
├── 📄 README.md # Project documentation (this file)
├── 📄 CMakeLists.txt # CMake build configuration
├── 📄 Makefile # Alternative build system
│
├── 📁 include/ # Header files (Declarations)
│ ├── Component.h # Base component class (OOP)
│ ├── PartCatalog.h # Hash table implementation
│ ├── CompatibilityGraph.h # Graph data structure
│ └── gui/
│ ├── GUIManager.h # Main GUI controller
│ └── Button.h # Button UI element
│
├── 📁 src/ # Source files (Implementation)
│ ├── main.cpp # Application entry point (GUI)
│ └── gui/
│ ├── GUIManager.cpp # GUI implementation
│ └── Button.cpp # Button implementation
│
├── 📁 legacy_console/ # Console version (Legacy/Alternative)
│ ├── main_console.cpp # Console application entry point
│ ├── CMakeLists_console.txt # Console build configuration
│ └── include/
│ ├── BuildTree.h # Tree structure for hierarchy
│ ├── BudgetBuilder.h # Greedy algorithm implementation
│ └── AssemblyGuide.h # Queue-based assembly planning
│
├── 📁 build_clean/ # Build output (Generated by CMake)
│ ├── CMakeFiles/ # CMake temporary files
│ ├── _deps/ # External dependencies
│ │ ├── sfml-build/ # SFML library build
│ │ ├── freetype-build/ # FreeType font library
│ │ ├── ogg-build/ # Ogg codec library
│ │ └── vorbis-build/ # Vorbis audio library
│ └── PCMasterBuilder.exe # Compiled executable (Windows)
│
└── 📁 saved_builds/ # User build configurations
├── build_20260120_115842.txt # Sample saved builds
├── build_20260120_115845.txt
└── build_20260120_115846.txt
- PartCatalog.h - Hash table mapping component IDs to component properties
- CompatibilityGraph.h - Graph representing hardware compatibility rules and constraints
- Component.h - Base class for all hardware components (CPU, GPU, RAM, etc.)
- GUIManager - Main application controller, coordinates all UI updates and state
- Button - Clickable UI element for component selection and navigation
- Screen - Screen state management using Stack-based navigation history
- BuildTree - N-ary tree representing PC system hierarchy and structure
- BudgetBuilder - Priority queue-based budget optimization algorithm
- AssemblyGuide - Queue-based assembly step generation and sequencing
| Category | Details |
|---|---|
| Full Name | M Zaid |
| m.zaid.tech@gmail.com | |
| Portfolio | zaidx.me |
| GitHub | @M-Zaid-Git |
| Semester | 3rd Semester |
| Department | Computer Science / Software Engineering |
| University | University of the Punjab |
| Location | Lahore, Pakistan |
For questions, feedback, bug reports, or collaboration opportunities:
| Channel | Link |
|---|---|
| m.zaid.tech@gmail.com | |
| Portfolio | zaidx.me |
| GitHub Profile | @M-Zaid-Git |
| GitHub Issues | Report issues |
| GitHub Discussions | Join discussions |
This project is developed for educational purposes as part of the Data Structures and Algorithms course at the University of the Punjab.
License: Educational Use Only
Copyright © 2026 M Zaid
University of the Punjab, Lahore, Pakistan
This project is provided for educational and learning purposes only.
Commercial use or redistribution without permission is prohibited.
- Course Instructor - Data Structures and Algorithms Course Team
- University of the Punjab - For the course structure and guidance
- SFML Library - For excellent cross-platform graphics capabilities
- C++ Standard Library - For reliable and efficient STL containers
- CMake Community - For cross-platform build system support
This project is developed as an educational assignment and represents the author's learning journey in DSA concepts. While efforts have been made to ensure code quality and correctness, it may not be suitable for production use.
Made with ❤️ for learning and education