Skip to content

ak23bar/Data-Structures-and-Algorithms

Repository files navigation

Data Structures and Algorithms

This repository contains all programming labs and major projects completed as part of my coursework in Data Structures and Algorithms. The course focused on the design, implementation, and analysis of fundamental data structures using modern C++. Each component in this repository reflects a key concept covered during the semester, along with practical applications ranging from text processing to pathfinding.


Labs

The labs provided weekly practice with core topics in C++ and data structure implementation. They covered everything from memory models and pointer arithmetic to templates and container design.

  • LAB01 – Set up the C++ development environment and reviewed basic syntax, I/O handling, and compiler usage.
  • LAB 02 – Focused on pointer operations, reference variables, and understanding memory access patterns.
  • LAB 03 – Implemented sorting algorithms and function pointers, using maps to organize and process data.
  • LAB 04 – Explored dynamic memory allocation and compared the functionality and performance of vector and map.
  • LAB 05 – Built a singly linked list from scratch, with emphasis on manual memory management and debugging techniques.
  • LAB 09 – Introduced binary search trees by building a basic string-based BST, emphasizing recursion and structural properties.
  • LAB 13 – Implemented a min-heap from the ground up, focusing on tree representation using arrays and heap operations such as insert and extract-min.

Projects

Six major projects were completed over the duration of the course, each highlighting key principles in algorithm design, runtime analysis, and object-oriented programming. All projects were fully implemented and authored by me, with each submission earning available extra credit.

1. Caesar Cipher Decoder

A frequency-analysis-based decoder for messages encrypted using the Caesar cipher. It identifies the most likely shift by comparing letter frequency distributions in the input text with known patterns in English.

2. Search Engine

A simple document search tool that reads plain text files, removes stop words, and allows keyword-based searching using AND/OR logic. Efficiently implemented using sets and maps to build an inverted index.

3. Linked List and CircVector (CanvasList)

Created a drawing command list system using both a singly linked list and a circular vector. The project emphasized memory safety, abstract base class inheritance, and virtual dispatch. Included support for undo operations, iteration, and string-based command interpretation.

4. HashMap

Designed and implemented a custom hash table using open addressing and linear probing. Supported key insertion, deletion, lookup, and dynamic resizing based on load factor. Benchmarked performance against STL equivalents.

5. Binary Search Tree (BST)

Implemented a complete binary search tree with recursive insert, delete, search, and traversal algorithms. Also included visual helpers to understand balancing behavior and traversal order outputs.

6. OpenStreetMap Graph Navigator (OSM)

Built a graph from real-world OpenStreetMap data and implemented shortest path algorithms (Dijkstra’s and A*). Supported user input for start/end points and displayed computed paths across road networks.


Topics Covered

  • Pointers, dynamic memory, and value/reference semantics
  • Recursion and tree-based algorithms
  • STL containers (vector, map, set, etc.)
  • Graph construction and traversal
  • Custom hash tables and hashing strategies
  • Object-oriented design with inheritance and interfaces
  • Time complexity and performance tradeoffs
  • File parsing and string tokenization
  • Iterator and template design

Tools & Environment

  • Language: C++17
  • Development Environment: Visual Studio Code
  • Testing: Manual test harnesses, Valgrind for memory debugging

About

All work in this repository reflects original coursework submitted for academic credit. It demonstrates a progression in problem-solving, system design, and understanding of real-world algorithmic challenges. Each folder includes well-commented code and, where applicable, documentation or instructions.

For further inquiries, feel free to connect with me on LinkedIn or reach out via email.

About

DSA in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published