[go: up one dir, main page]

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 various Abstract Data Types (ADTs) such as stacks, queues, and binary search trees. It includes tasks for implementing algorithms like BFS, DFS, Prim's, and Kruskal's, as well as sorting methods like quick sort and merge sort. Each experiment specifies objectives and requires code implementation and output for verification.

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 DOCX, 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 various Abstract Data Types (ADTs) such as stacks, queues, and binary search trees. It includes tasks for implementing algorithms like BFS, DFS, Prim's, and Kruskal's, as well as sorting methods like quick sort and merge sort. Each experiment specifies objectives and requires code implementation and output for verification.

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 DOCX, 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 linked


2
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-Trees


7
and AVL-trees:

a) Insertion.

b) Deletion.

Write programs for implementing BFS and DFS for a given


8
graph.

Write programs to implement the following to generate a


9
minimum cost-spanning tree:

a) Prim’s algorithm.
S.
Title of Experiment Date Signature
No.

b) Kruskal’s algorithm.

Write a program to solve the single source shortest path problem


10
(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