You are on page 1of 2

Data Structures and Algorithms Assignment

Roll number wise 3 students in a group and each group to execute one problem. Say group 1(roll
numbers 1,2,3) first question and so on.

Write a C/ C++ routine and execute the following functions:

1. Reverse a list so that the last element becomes the first, and so on using circular
linked lists.

2. Make a second copy of the list using circular linked lists.

3. Add two polynomials say f(x,y) and g(x,y) and store the result in h(x,y).

4. Determine whether two binary trees are mirror similar or not.

5. Accept a pointer to a BST and delete the largest element from the tree.

6. Accept a string of characters and insert in a binary search tree.

7. Traverse a binary tree in postorder using non-recursive routine with additional queue.

8. Form a list containing the union of the elements of two lists using circular linked lists.

9. Generate a spanning tree using BFS. Find the running time complexity.

10. Improvise all to all shortest path routine to give the length of the shortest path
between any two vertices.

11. Form a list containing the intersection of the elements of two lists doubly linked lists.

12. Accept a pointer to an expression binary tree and return the value of the expression.

13. Use Dijkstras shortest path approach to find the shortest path from vertex a to b.

14. Insert an element after nth element of the list doubly linked lists.

15. Find the running time complexity of Quicksort method when all elements are in (i)
ascending order and (ii) random.

16. Accept a pointer to a node of a binary tree and return the level of that node in the tree.

17. Find number of nodes in a binary tree using non-recursive function.

18. Find the depth of a binary tree using recursive function.

19. Interchange the mth and nth elements of a doubly linked lists.

20. Find whether two binary trees are similar.


21. Accept a pointer to a BST and delete the smallest element from the tree.

22. Traverse a binary tree in pre-order using non-recursive function.

23. Find if the binary tree is a complete binary tree.

24. Generate a spanning tree using DFS. Find the running time complexity.

25. Find the running time complexity of Radix sort method.

26. Reverse a string using recursive function.

27. Given a long integer find the number of subsequences divisible by 3 using dynamic
programming.

28. Combine two ordered lists into a single ordered list doubly linked lists.

You might also like