Assignment 9-A

DSA Implementation

Implement classic data structures from scratch using dynamic memory allocation, including linked lists, stacks, queues, and binary trees.

6-8 hours
Advanced
100 Points
What You'll Practice
  • Linked list operations
  • Stack (LIFO)
  • Queue (FIFO)
  • Binary search tree
  • Memory management
01

Tasks

1
Singly Linked List

Create linked_list.c implementing:

  • Insert at beginning, end, specific position
  • Delete from beginning, end, specific position
  • Search for element
  • Reverse the list
  • Display all elements
  • Free all nodes (cleanup)
2
Stack Implementation

Create stack.c implementing:

  • push(), pop(), peek() operations
  • isEmpty(), isFull() checks
  • Display stack contents
  • Application: Balanced parentheses checker
3
Queue Implementation

Create queue.c implementing:

  • enqueue(), dequeue(), front() operations
  • Circular queue for efficient memory use
  • Display queue contents
  • Application: Simple task scheduler
4
Binary Search Tree

Create bst.c implementing:

  • Insert node
  • Search for value
  • In-order, pre-order, post-order traversals
  • Find minimum and maximum
  • Delete node (bonus: +10 points)
02

Submission

assignment-9-dsa/
├── linked_list.c
├── stack.c
├── queue.c
├── bst.c
└── README.md
03

Grading Rubric

CriteriaPoints
Linked List (all operations)25
Stack + Parentheses checker25
Circular Queue + Task scheduler25
BST (without delete)25
Bonus: BST delete operation+10
Total100 (+10)