CP4161 1
CP4161 1
1. (a)Write and execute a C++ program that uses recursive function for tree traversal.
(b)Write and execute a C++ program for implementing the traversal algorithm for Breadth first
search.
(a) Write and execute a C++ program that uses iterative function for tree traversal.
2.
(b) Write and execute a C++ program for implementing the traversal algorithm for Depth first
search.
3. (a) Write and execute a C++ program that uses recursive function for generating Fibonacci
series.
(b) Write and execute a C++ program for implementing Merge sort
(a) Write and execute a program that uses iterative function for generating Fibonacci series.
4.
(b) Write and execute a C++ program for implementing Quick sort
Write and execute a program for Binary Search Tree to implement following operations:
5.
a. Insertion
b. Deletion
i. Delete node with only child
ii. Delete node with both children
c. Finding an element
d. Finding Min element
e. Finding Max element
f. Left child of the given node
Page 1 of 3
g. Right child of the given node
h. Finding the number of nodes, leaves nodes, full nodes, ancestors, descendants
Write and execute a program to implement Red-Black trees with insertion and deletion operation
6.
for the given input data.
Write and execute a program to generate minimum spanning tree in a connected, undirected
8.
weighted graph using Prims algorithm.
(a)Write and execute a program for implementing the traversal algorithm for Breadth first search
9.
(b) Write and execute a program for implementing Quick sort
10. Write and execute a program to implement Dijkstra’s algorithm for single-source shortest path in
a weighted directed graph
Write and execute a program to find single-source shortest path in a weighted directed graph
11.
using BellmanFord algorithm
Write and execute a program to generate minimum spanning tree in a connected, undirected
12.
weighted graph using Kuruskal’s algorithm with disjoint set data structures.
Write and execute a program to implement Matrix Chain Multiplication
13.
Page 2 of 3
19. Write and execute a program that uses iterative function for tree traversal and Fibonacci
sequence generation.
20. Write and execute a program for implementing the following traversal algorithm
Page 3 of 3