A comprehensive collection of data structure implementations from the CSE220 (Data Structures) course at BRAC University, Fall 2023 semester.
This repository contains implementations of fundamental data structures covered in CSE220, including:
- Arrays & Array Operations: Multi-dimensional arrays, matrix operations, pattern generation
- Linked Lists: Singly linked lists, operations, and manipulations
- Doubly Linked Lists: Circular doubly linked lists, patient management system
- Stacks: Array-based and linked-list implementations, parenthesis balancing
- Queues: Standard and priority queue implementations
- Recursion: Various recursive algorithms and problem-solving techniques
- Hash Tables: Hash functions, collision handling, layered hashing
- Binary Trees: BST operations, traversals, tree algorithms
CSE220-Data-Structures/
├── Lab01/ # Arrays and numpy operations
├── Lab02/ # Multi-dimensional arrays
├── Lab03/ # Singly linked lists
├── Lab04/ # Circular doubly linked lists
├── Lab05/ # Recursion fundamentals
├── Lab06/ # Stack implementations
├── Lab07/ # Hash tables and hashing
├── Lab08/ # Binary trees and BST
├── LICENSE
└── README.md
Each lab folder contains:
- Jupyter Notebook (
.ipynb) with complete implementations - Lab-specific README with problem descriptions
- Test cases and driver code
- Python 3.8 or higher
- Jupyter Notebook or JupyterLab
- NumPy library
- fhm-unittest (for testing)
- fuzzywuzzy (for output validation)
- Clone the repository:
git clone https://github.com/777-flyer/Data-Structures.git
cd Data-Structures- Install required packages:
pip install numpy jupyter fhm-unittest fuzzywuzzy- Launch Jupyter Notebook:
jupyter notebook- Navigate to any lab folder and open the notebook.
- Play Right (array rotation)
- Discard Cards (element removal)
- Merge Lineup (array merging with None handling)
- Balance Salami (equilibrium point)
- Protect Salami (duplicate frequency check)
- Bonus: Odd-Even Wave pattern
Key Concepts: Array manipulation, iteration, boundary conditions
- Zigzag Walk (2D array traversal)
- Wall Up Trost District (matrix padding)
- Crows vs Cats (matrix pair operations)
- ATM's Triangle (Pascal-like triangle generation)
- Trace The BOT (grid navigation)
Key Concepts: 2D arrays, matrix operations, pattern generation, coordinate systems
- Number Beads (rotation detection)
- Building Blocks (list comparison)
- Remove Compartment (node deletion)
- Capture the Flag (divisibility pattern)
- Shuffle on Song (even-odd ASCII reordering)
- Bonus: Assemble Conga Line, Remove from Last
Key Concepts: Linked list traversal, node manipulation, insertion, deletion
- Waiting Room Management System (WRM)
- Patient registration with serial numbers
- Serve patients (FIFO)
- Cancel all appointments
- Check if doctor can leave
- Show all patients
- Reverse the line
Key Concepts: Circular doubly linked lists, dummy nodes, queue-like operations
- Very Easy: Recursive sum, nCr calculation, digit counting, prime checking
- Easy: Decimal to hexadecimal conversion, linked list comparison, vowel-consonant printing
- Medium: House of Cards builder, maximum element finder
- Hard: Number patterns (triangular and exponential)
- Very Hard: Flatten nested lists
Key Concepts: Base cases, recursive calls, divide and conquer, backtracking
- Stack implementation (push, pop, peek, isEmpty)
- Parenthesis balancing (brackets validation)
- Diamond count (matching pairs)
- Bonus: Tower of God (remove n-th block)
Key Concepts: LIFO operations, stack-based algorithms, expression validation
- Nerdy Run (duplicate detection within distance k)
- Hash table with chaining (custom hash function)
- Layered hashtable (express lane optimization)
Key Concepts: Hash functions, collision resolution, chaining, layered data structures
- Convert to mirror tree (tree reflection)
- Smallest value per level (level-order processing)
- Inorder predecessor in BST
- Lowest Common Ancestor (LCA) in BST
- Bonus: Sum tree validation, odd-even level difference
Key Concepts: Tree traversals, BST properties, ancestor finding, tree validation
| Data Structure | Lab | Operations | Time Complexity |
|---|---|---|---|
| Arrays | 01, 02 | Access, Insert, Delete | O(1), O(n), O(n) |
| Singly Linked List | 03 | Insert, Delete, Search | O(1), O(n), O(n) |
| Doubly Linked List | 04 | Insert, Delete, Reverse | O(1), O(n), O(n) |
| Stack | 06 | Push, Pop, Peek | O(1), O(1), O(1) |
| Hash Table | 07 | Insert, Search, Delete | O(1) avg, O(n) worst |
| Binary Tree | 08 | Insert, Search, Traverse | O(log n) avg BST |
- Implementing fundamental data structures from scratch
- Understanding time and space complexity trade-offs
- Working with pointers and references
- Solving real-world problems with appropriate data structures
- Writing clean, modular, and well-documented code
- Testing and validating implementations
- Recursion and iterative problem-solving techniques
Each notebook includes test cases using the fhm-unittest framework:
import fhm_unittest as unittest
returned_value = your_function(parameters)
unittest.output_test(returned_value, expected_value)Look for "Accepted" output to verify correctness.
This project is licensed under the MIT License - see the LICENSE file for details.
While this is primarily an educational repository, suggestions for improvements are welcome:
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement) - Commit your changes (
git commit -am 'Add improvement') - Push to the branch (
git push origin feature/improvement) - Open a Pull Request
For questions or discussions about the implementations:
- Create an issue in this repository
- Connect via LinkedIn
- Institution: BRAC University
- Course: CSE220 - Data Structures
- Semester: Fall 2023
I would like to sincerely thank the course faculty for their guidance and support throughout the semester:
-
Mr. Zaber Mohammad
Lecturer, Department of Computer Science and Engineering
BRAC University -
Priata Nowshin
Lecturer, Department of Computer Science and Engineering
BRAC University -
Nazia Afreen
Lecturer, Department of Computer Science and Engineering
BRAC University
This repository is shared publicly for learning and reference purposes. While you're welcome to study the implementations and understand the concepts, please do not copy code directly for your coursework or assignments.
Academic integrity matters. Use this as a learning resource to build your own understanding, not as a shortcut. Your future self (and your professor) will thank you.
Note: This repository represents coursework completed in Fall 2023. Jupyter notebooks are included for interactive exploration and learning. Problem statements are proprietary to BRAC University and are not included to respect copyright.
Happy Coding!