CA-C5P: DATA STRUCTURES LAB
NOTE: For all the programs write the output, flowchart and number of basic operations performed.
1. Given {4,7,3,2,1,7,9,0} find the location of 7 using Linear and Binary search and also display its first
occurrence.
2. Given {5,3,1,6,0,2,4} order the numbers in ascending order using Bubble Sort Algorithm
3. Perform the Insertion and Selection Sort on the input {75,8,1,16,48,3,7,0} and display the output in
descending order.
4. Write a program to insert the elements {61,16,8,27} into singly linked list and delete 8,61,27 from the
list. Display your list after each insertion and deletion.
5. Write a program to insert the elements {61,16,8,27} into linear queue and delete three elements from the
list. Display your list after each insertion and deletion.
6. Write a program to insert the elements {61,16,8,27} into circular queue and delete 4 elements from the
list. Display your list after each insertion and deletion.
7. Write a program to insert the elements {61,16,8,27} into ordered singly linked list and delete 8,61,27
from the list. Display your list after each insertion and deletion.
8. Write a program to add 6x 3+10x2 +0x+5 and 4x2+2x+1 using linked list.
9. Write a program to push 5,9,34,17,32 into stack and pop 3 times from the stack, also display the popped
numbers.
10. Write a recursive program to find GCD of 4,6,8.
11. Write a program to inert the elements {5,7,0,6,3,9} into circular queue and delete 6,9&5 from it(using
linked list implementation)..
12. Write a program to convert an infix expression x^y/(5*z)+2 to its postfix expression
13. Write a program to evaluate a postfix expression 5 3+8 2 – *.
14. Write a program to create a binary tree with the elements {18,15,40,50,30,17,41} after creation insert 45
and 19 into tree and delete 15,17 and 41 from tree. Display the tree on each insertion and deletion
operation
15. Write a program to create binary search tree with the elements {2,5,1,3,9,0,6} and perform inorder,
preorder and post order traversal.
16. Write a program to Sort the following elements using heap sort {9.16,32,8,4,1,5,8,0}
17. Given S1={“Flowers”} ; S2={“are beautiful”} I. Find the length of S1 II. Concatenate S1 and S2 III.
Extract the substring “low” from S1 IV. Find “are” in S2 and replace it with “is”