Coursework, homework assignments, and lab assesments solutions for CSE 106: Data Structures and Algorithms I Sessional at BUET.
- Course Overview
- Directory Structure
- Offline Assignments
- Online Lab Exams
- Related Repositories
- How to Compile and Run
- Author & Maintainer
This repository contains the coursework, homework assignments, and lab exam solutions for the CSE 106: Data Structures and Algorithms I Sessional course at Bangladesh University of Engineering and Technology (BUET).
The course is structured around two main assessment components:
- Offline Assignments: Comprehensive assignments completed at home, focused on implementing core data structures and algorithmic paradigms from scratch.
- Online Lab Assesments: Time-constrained lab assesments conducted in the BUET laboratory (VDAL) to test problem-solving ability, algorithmic efficiency, and the application of offline concepts to new scenarios.
CSE_106/
βββ Offline/ # Homework assignments (from home)
β βββ Offline_01/ # List ADT (ArrayList & Doubly Linked List)
β βββ Offline_02/ # Queue ADT & Stack (Syntax Checker)
β βββ Offline_03/ # Binary Search Tree (BST) & Auction Bid Tracker
β βββ Offline_04/ # Graph Theory (Tournament Groups & Unplayed Matches)
β βββ Offline_05/ # Min-Heap ADT & HeapSort
β βββ Offline_06/ # Divide & Conquer (Emergency Communication Network)
β βββ Offline_07/ # Dynamic Programming (Global Sequence Alignment / Edit Distance)
βββ Online/ # Lab exam problems (in BUET lab)
βββ Online_01/ # Array Triplet Sum (O(N^2) time & space)
βββ Online_02/ # List Block Reversal & Stack Duplicate Removal
βββ Online_03/ # Lowest Common Ancestor (LCA) in BST
βββ Online_04/ # Graph Mutual Friends & Stranger Finder
βββ Online_05/ # Min-Heap k-Largest Elements (Descending Order)
βββ Online_06/ # Damerau-Levenshtein Distance (DP with Transposition)
Concepts: Sequential List, ArrayList, Doubly Linked List, ADT Design
Developed an integer-based List Abstract Data Type (ADT) from scratch using two separate approaches:
- ArrayList (Dynamic Array representation with automatic resizing).
- Doubly Linked List (Pointer-based node representation).
π View Details
- Supported Operations: Current position tracking (
|), insertion, deletion, appending, search, traversal (next/prev), range swaps, and list reversal.
Concepts: Linear Data Structures, Circular Queue, Compilers & Syntax Parsing
Implementation of basic linear data structures and their direct applications:
- Queue ADT: Implemented a generic Queue ADT using both dynamic arrays (Circular Queue) and linked lists.
- Compiler Syntax Checker: Parsed source code files to build a syntax/bracket checker using Stacks to detect unbalanced parentheses, braces, and brackets, identifying the exact line numbers and mismatched characters.
Concepts: Tree Data Structures, Templates, Real-time Query Systems
A dual-part project implementing tree structures and real-time transaction tracking:
- BST Implementation: Created a template-based Binary Search Tree storing generic key-value pairs. Supported insertion, deletion, lookup, minimum/maximum query, successor/predecessor traversal, and nested representation formatting.
- Auction Bid Tracker: Developed a system simulating bidding events (inserting bids, updating bids, and finding highest/lowest bids) powered by the BST.
Concepts: Graph Theory, Connected Components, BFS, DFS
Given a list of tournament match outcomes, reconstructed group structures using Connected Components analysis. For each group, identified and listed all expected matches that had not yet been played.
Concepts: Binary Heaps, Bottom-up Heapification, HeapSort
Implemented an array-based Min-Heap supporting bottom-up
Concepts: Divide & Conquer, Geometric Connectivity, Closest Pair of Points
Solved a geometric city-connectivity problem. Given
Concepts: Dynamic Programming, Edit Distance, Sequence Alignment
Computed the minimum cost required to align/transform a source sequence into a target sequence using insertions, deletions, and substitutions (each with custom costs). Traced and reconstructed the exact sequence of edit operations.
Concepts: Array Traversals, Sorting, Two-Pointer Approach
Given an array of integers, found any triplet of unique indices
Concepts: List Reversal, Stacks, Linear Time Complexity
Two separate challenges on basic data structure manipulations:
-
Problem 1: Added
reverse_range(int k)to the List ADT to reverse consecutive blocks of size$k$ without allocating extra memory or auxiliary data structures. -
Problem 2: Used a Stack to iteratively remove all adjacent duplicate characters from a string in a single
$O(N)$ linear pass (e.g.,"abbaca"$\rightarrow$ "ca").
Concepts: BST Ancestors, Time & Space Complexity Optimization
Implemented a method find_lca(Key key1, Key key2) to find the Lowest Common Ancestor of two existing keys in a BST in
Concepts: Social Network Analysis, Graph Traversal
Analyzed a friendship network to identify all users who are "strangers" to a person of interest
Concepts: Heap Traversal, Output Redirection
Added kLargest(int k, std::ofstream &outfile) to the Min-Heap class to find and print the
Concepts: Dynamic Programming, Transposition Operations
Extended the classic edit distance algorithm by incorporating a fourth transposition operation (swapping two adjacent characters, e.g., "ca" "ac" at cost 1). Computed the minimum operations using a DP-based approach.
Explore other academic repositories containing coursework, implementations, and study materials:
| Repository | Description | Language / Tech |
|---|---|---|
| 𧬠DSA Genesis | A comprehensive repository covering fundamental to advanced Data Structures and Algorithms implementations. | C++17 |
| π¨ AlgoVista | An interactive Data Structures and Algorithms visualizer designed to make learning algorithms intuitive and visual. | JavaScript / HTML |
| π OOPverse | A dedicated space for Object-Oriented Programming (OOP) concepts, designs, and principles. | Java / C++ |
All implementations are in standard C++ (C++11 or higher) and C. You can compile the files using any standard compiler such as g++ or gcc.
# Compile
g++ -O3 -std=c++11 solution.cpp -o solution
# Run
./solution# Compile
gcc -O3 main.c -o main
# Run
./mainNote: No external libraries are required. All solutions depend only on the C/C++ standard library.
Badhon Pain
- π Undergraduate Student of Computer Science and Engineering
- π Bangladesh University of Engineering and Technology (BUET)
- π GitHub: @BadhonPain
Maintained as part of coursework at BUET.