0% found this document useful (0 votes)
5 views8 pages

C Programming: Data Structures & Algorithms

The document outlines a series of programming exercises focused on data structures and algorithms, specifically involving matrix operations, arrays, stacks, queues, linked lists, sorting, and binary trees. Each exercise includes specific implementation tasks in C, requiring the creation and manipulation of various data structures and algorithms. The exercises are designed to enhance understanding of fundamental programming concepts and data handling techniques.

Uploaded by

vitsucks17
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views8 pages

C Programming: Data Structures & Algorithms

The document outlines a series of programming exercises focused on data structures and algorithms, specifically involving matrix operations, arrays, stacks, queues, linked lists, sorting, and binary trees. Each exercise includes specific implementation tasks in C, requiring the creation and manipulation of various data structures and algorithms. The exercises are designed to enhance understanding of fundamental programming concepts and data handling techniques.

Uploaded by

vitsucks17
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

The Experiment format

Aim:

Algorithm:

(Pseudocode steps)

Program in C

Output

(Screenshots of your C program outputs with YOUR REGISTRATION NUMBER ON EACH OUTPUT)

The output should have minimum three test cases.


EXERCISE NO:1
EXPT 1&2 - Stack and Queue (10 Marks)

All Matrix programs should ask for rows and columns from user.
1. Matrix Addition
2. Matrix Subtraction
3. Matrix Multiplication (Number of columns in Matrix A must equal Number of rows in
Matrix B)
4. Array(1D, 2D, 3D) – 3 programs
•Traversing (Array limits L- Lower Bound, U-Upper Bound)
•Searching (Array limits L- Lower Bound, U-Upper Bound, Found=0, Location=0)
•Insertion (Empty/Full), Use Searching Algo for location, Insert the element, move the
remaining elements towards the Upper bound and update the Upper Bound size
•Deletion (Empty/Full), Use Searching Algo for (location, Element) and move the next
element to the location( Update or Overwrite in the same location) and update the Upper
Bound size
•Merging (Array limits L- Lower Bound, U-Upper Bound of each)
5. STACK
•push() to insert an element into the stack
•pop() to remove an element from the stack
•top() Returns the top element of the stack.
•isEmpty() returns true if stack is empty else false.
•isFull() returns true if the stack is full else false.
6. Pointers in C (Call by Reference, Call by Value, calling function using pointers, Calling
Structure using Pointers) – 4 programs
[Link] of Stack using arrays and stack using Linked List – 2 programs
[Link] of Tower of Hanoi with multiple Discs and Pillars
[Link] of Infix to Postfix
[Link] of Infix to Prefix
[Link] of Postfix Evaluation
[Link] of Queue using arrays and stack using Linked List – 2 programs
[Link] of Queue using circular concept
[Link] of Queue using Double Ended Queue Concept Input Restricted method
[Link] of Queue using Double Ended Queue Concept Output Restricted method
EXERCISE NO:2
EXPT 3&4 - Linked List and Searching (10 Marks)
1. Implementation of Stack using Single Linked Lists
2. Implementation of Queue using Single Linked List
3. Implementation of Queue using Double Linked List
4. Implementation of Linked list creation and Traversing
5. Implementation of Linked list creation, Insertion at Front, End, Any Position
6. Implementation of Linked list creation, Delete at Front, End, Any Position
7. Implementation of Traversing the list
8. Implementation of Inserting a node into the list
9. Implementation of Linked list Deleting a node from the list
10. Implementation of Copying the list to make a duplicate of it
11. Implementation of Merging the linked list with another one to make a larger list
12. Implementation of Linear Search
13. Implementation of Binary search using iterative method
14. Implementation of Binary search using recursive method
EXERCISE NO:3
EXPT 5 – Sorting (5 Marks)
1. Implementation of Bubble sort
2. Implementation of Insertion sort
3. Implementation of Selection sort
4. Implementation of Counting sort
5. Implementation of Quick sort
6. Implementation of Merge sort
EXERCISE NO:4
EXPT 6&7 - Binary Tree and Binary Search Tree (5 Marks)
1. Implementation of Binary Tree (Create, Insert, Deleting a node(Root, left child, Right
Child ,descendant), Searching the kth element, traversal, Preorder, Inorder, Post order,
level order)
A. Basic Depth-First Traversals (DFS)
1. Inorder Traversal (Recursive)
2. Inorder Traversal (Iterative using Stack)
3. Preorder Traversal (Recursive)
4. Preorder Traversal (Iterative using Stack)
5. Postorder Traversal (Recursive)
6. Postorder Traversal (Iterative using Two Stacks)
7. Postorder Traversal (Iterative using One Stack)
B. Breadth-First Traversal (BFS)
8. Level Order Traversal (BFS using Queue)
9. Level Order Traversal (Line by Line printing)
10. Left sub tree of Binary Tree
11. Right sub tree of Binary Tree
12. Print all Leaf Nodes
13. Print all Root-to-Leaf Paths

2. Implementation of Binary Search Tree (Create, Insert, Deleting a node(Root, left child,
Right Child ,descendant), Searching the kth element, traversal, Preorder, Inorder, Post
order, level order)

A. Basic Depth-First Traversals (DFS)


1. Inorder Traversal (Recursive) → (gives sorted order in BST)
2. Inorder Traversal (Iterative using Stack)
3. Preorder Traversal (Recursive)
4. Preorder Traversal (Iterative using Stack)
5. Postorder Traversal (Recursive)
6. Postorder Traversal (Iterative using Two Stacks)
7. Postorder Traversal (Iterative using One Stack)
B. Breadth-First Traversals (BFS)
8. Level Order Traversal (using Queue)
9. Level Order Traversal Line by Line
10. Print BST in Sorted Order (Inorder Traversal)
11. Print BST in Descending Order (Reverse Inorder Traversal)
12. K-th Smallest Element in BST (using Inorder Traversal)
13. K-th Largest Element in BST (using Reverse Inorder Traversal)
14. Range Search (Print all keys between [L, R])
15. Successor and Predecessor of a Node in BST (Inorder-based)
16. Left View of BST
17. Right View of BST
18. Print All Root-to-Leaf Paths in BST
19. Print Ancestors of a Given Key
20. Check if a Given Traversal (Preorder/Inorder/Postorder) can Represent a BST

You might also like