Implement Prim’s algorithm on your system. Process the result step by step and study the
performance of the algorithm on different graphs.
Write a program to check that the left sub-tree of an binary tree (Not BST) is mirror image of its right sub-tree.
Write a program to construct a binary tree from given sequence of preorder and inorder traversal of the tree (preorder & inorder sequence is to be entered by the user).
Write a program to implement four numbers of D-queues in an array.
Write a function template to add two numbers. Overload the function template to add three numbers. The third template argument should have the default value as <int> . When the function is called with char type of arguments, the characters should be concatenated to form a string.
Practice programs: Consider a book shop which sells both books and video tapes. Create a class media that stores the title and price of a publication. Derive two classes from media, one for storing the number of pages in a book and another for storing playing time of a tape. Write a C++ program using run time polymorphism to implement it.
Write a program which produces the given sequences numbers (in alternate arrangement and reverse order of the problem no. 2) using the three
looping statements: 5, 1, 4, 2, 3, 3, 2, 4, 1, 5,
1st Solution – using for loop
2nd Solution – using while loop
3rd Solution-‐ using do while loop
Write a program to calculate the factorial value of the input number n! Use the incrementation formula ( i++ ) for your solution instead of decrementation formula (i-‐-‐).
Apply the three looping statements for your solutions:
Enter a no. 4 Factorial value is: 24 (The computation is: 1*2*3*4=24)
1st Solution – using for loop
2nd Solution – using while loop
3rd Solution-‐ using do while loop
Write a program that generates and displays the Fibonacci sequences numbers of n (as input). In Fibonacci, the current third number is the sum of two previous numbers. Apply three solutions using the three loop statements: Sample input/output dialogue: Enter a no. 9 Fibonacci series: 1 1 2 3 5 8 13 21 34
1st Solution using for loop
2nd Solution – using while loop
3rd Solution-‐ using do while loop
write a program that calculates the power value of the input base number and exponent number. Apply three solutions using the three looping statements: Sample input/output dialogue Enter base no. 5 Input data Enter exponent no. 3 Second input data Power value: 125 Output value (The computation is: 53 = 5 * 5 * 5 = 125)
1st Solution – using for loop
2nd Solution –using while loop
3rd Solution-‐ using do while loop