Semester : SEMESTER 2
Subject : Data Structures
Year : 2017
Term : MAY
Branch : MCA
Scheme : 2016 Full Time
Course Code : RLMCA 104
Page:2
(28001 Pages:2
12. Write a recursive algorithm using stack to list out all prime factors of a given number
in ascending order.
MODULE III
13. (i) Write an algorithm to delete an element from a linked queue. (4)
(ii) Write any two representations of a priority queue. (2)
OR
14. Write an algorithm that reverses all the elements in a queue using stack.
MODULE IV
15. Write an algorithm to add two polynomials using linked list. What is the time
complexity of the algorithm if the polynomials have M and N terms respectively?
OR
16. Given two sorted lists 1.1 and L2. Write an algorithm to compute 1.1 M L2 using only
the basic list operations.
MODULE V
17. (i) Define a Binary Search Tree. (2)
(ii) Show the result of inserting 3, 1, 5, 6, 10, 2, 5, 8 into an initial empty binary search
tree. (2)
(iii) Show the result of deleting the root. (2)
OR
18. Write an algorithm to solve the single source shortest path problem with an example.
MODULE VI
19. (1) Show how heapsort processes the input 14,54,12,6,45,88,57,43,11 (4)
(ii)What is the running time of heapsort algorithm for
1) Sorted input in ascending order 2) sorted input in descending order (2)
OR
20. Write a recursive algorithm for merge sorting .What is the worst case complexity of
that algorithm?
ak
Page 2 of 2