Welcome to the official Data Structure Lab Repository for BS (AI) β Group A & Group B. This repository contains all lab tasks, starter code, assignments, and additional resources for the course.
Course Instructor: Syed Shayan Ali Shah Course Duration: 16 September β 15 January Lecture Days: Thursday & Friday (Weekly) Programming Language: C++
This lab focuses on hands-on implementation of core data structures using C++. Students will learn how data is organized, manipulated, and traversed in memory, using both array-based and linked representations.
We will follow the textbook Fundamentals of Data Structures in C++ by Horowitz, Sahni, and Mehta and cover the following topics:
-
Pointers Refresher
- Dereferencing
- Dynamic Memory Allocation (
new,delete) - Dangling Pointers & Memory Leaks
-
List Data Structures
- List Operations
- Array-based List Implementation
-
Linked Lists
- Creating Nodes
- Linking Nodes via Pointers
- Insertion, Searching, Deletion
- Singly, Doubly & Circular Lists
-
Stacks
- Array-based Implementation
- Linked List Implementation
- Applications: Expression Conversion, Postfix Evaluation, Bracket Matching
-
Queues
- Simple & Circular Queues
- Linked List Implementation
- Simulation Problems
-
Recursion & Trees
- Binary Trees, BSTs
- Traversals, Applications
- AVL Trees (Insertion & Deletion)
- Expression Trees, Huffman Coding
-
Heaps, Hashing, and Graphs
- Heap Operations
- Hash Functions, Collisions
- Graph Representations
- BFS and DFS Traversals
-
Weekly Updates: The repository will be updated weekly before each lecture with:
- Lab problems
- Starter code / skeletons
- Practice exercises
- Additional notes and resources
-
Student Workflow:
- Pull or download the latest lab task from GitHub before class.
- Complete the task during the lab session.
- Submit your solution (if required) according to instructions given in class.
- Compiler: g++ / any C++17 compliant compiler
- IDE: (Recommended) Code::Blocks / Visual Studio Code
- GitHub: Students must know how to clone, pull, and commit code.
- This repository is continuously evolving β check for updates every Wednesday evening.
- Focus on writing clean, well-commented code.
- Follow best memory management practices β avoid memory leaks and dangling pointers.
By the end of this lab, students will:
- Gain confidence in implementing data structures from scratch.
- Understand memory management and pointer manipulation in C++.
- Learn to solve real-world problems using data structures.
- Develop clean, maintainable, and efficient C++ code.