0% found this document useful (0 votes)
12 views19 pages

Dsa Lab File Complete

The document outlines a series of programming experiments focused on data structures and algorithms, including implementations of stacks, queues, binary search trees, and various sorting methods. Each experiment specifies the objective, such as using arrays or linked lists, and includes code and output sections. The document serves as a lab manual for students to practice and demonstrate their understanding of these concepts.

Uploaded by

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

Dsa Lab File Complete

The document outlines a series of programming experiments focused on data structures and algorithms, including implementations of stacks, queues, binary search trees, and various sorting methods. Each experiment specifies the objective, such as using arrays or linked lists, and includes code and output sections. The document serves as a lab manual for students to practice and demonstrate their understanding of these concepts.

Uploaded by

roysahil689
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Index Page

S.
Title of Experiment Date Signature
No.

1 Write programs to implement the following using an array:

a) Stack ADT

b) Queue ADT

Write programs to implement the following using a singly


2
linked list:

a) Stack ADT

b) Queue ADT

Write a program to implement the deque (double-ended queue)


3
ADT using a doubly linked list.

4 Write a program to perform the following operations:

a) Insert an element into a binary search tree.

b) Delete an element from a binary search tree.

c) Search for a key element in a binary search tree.

Write a program to implement circular queue ADT using an


5
array.

Write a program to implement all the functions of a dictionary


6
ADT using hashing.

Write a program to perform the following operations on B-


7
Trees and AVL-trees:

a) Insertion.

b) Deletion.

Write programs for implementing BFS and DFS for a given


8
graph.
S.
Title of Experiment Date Signature
No.

Write programs to implement the following to generate a


9
minimum cost-spanning tree:

a) Prim’s algorithm.

b) Kruskal’s algorithm.

Write a program to solve the single source shortest path


10
problem (using Dijkstra's algorithm).

Write a program that uses non-recursive functions to traverse a


11
binary tree in:

a) Pre-order.

b) In-order.

c) Post-order.

Write programs for sorting a given list of elements in ascending


12
order using the following sorting methods:

a) Quick sort.

b) Merge sort.
Lab Experiment 1
Objective:
Write programs to implement the following using an array.

a) Stack ADT

Code:

Output:
b) Queue ADT

Code:

Output:
Lab Experiment 2
Objective:
Write programs to implement the following using a singly linked list.

a) Stack ADT

Code:

Output:
b) Queue ADT

Code:

Output:
Lab Experiment 3
Objective:
Write a program to implement the deque (double-ended queue) ADT using a doubly linked list.

Code:

Output:
Lab Experiment 4
Objective:
Write a program to perform the following operations:

a) Insert an element into a binary search tree.


b) Delete an element from a binary search tree.
c) Search for a key element in a binary search tree.

Code:

Output:
Lab Experiment 5
Objective:
Write a program to implement circular queue ADT using an array.

Code:

Output:
Lab Experiment 6
Objective:
Write a program to implement all the functions of a dictionary (ADT) using hashing.

Code:

Output:
Lab Experiment 7
Objective:
Write a program to perform the following operations on B-Trees and AVL-trees:

a) Insertion. b) Deletion.

B-trees

Code:
Output:

AVL-Trees

Code:
Output:
Lab Experiment 8
Objective:
Write programs for implementing BFS and DFS for a given graph.

Code:

Output:
Lab Experiment 9
Objective:
Write programs to implement the following to generate a minimum cost-spanning tree:

a) Prim’s algorithm. b) Kruskal’s algorithm.

Code: a) Prim’s algorithm

Output:

Code: b) Kruskal’s algorithm


Output:
Lab Experiment 10
Objective:
Write a program to solve the single source shortest path problem.

Code:

Output:
Lab Experiment 11
Objective:
Write a program that uses non-recursive functions to traverse a binary tree in:

a) Pre-order. b) In-order. c) Post-order.

Code:

Output:
Lab Experiment 12
Objective:
Write programs for sorting a given list of elements in ascending order using the following sorting
methods:

a) Quick sort. b) Merge sort.

Code: Quick sort

Output:

Code: Quick sort

Output:

You might also like