Documente Academic
Documente Profesional
Documente Cultură
PART-A
Q1. (a) What do you mean by data structure?List down various operations
possible on data structures? (8)
(b) What do you mean by complexity? Discuss different types of complexity. (8)
Q2. (a) Show how to implement a queue by using an array Queue[50], where
Queue [0] & Queue [1] are always used to indicate front & rear of queue ,
respectively . Write algorithms for inserting & deleting an element from above
queue. (8)
(b) Explain how to implement two stacks in one array A[N] in such a way that
neither stack overflows unless the total number of elements in both stacks
together is ‘N’. Push & Pop operations should run in O(1) time. (12)
Q3. (a) Select the appropriate data structure to implement the following.
Explain why you selected it.
12+(((15-10)*(4-2)+10)/5)/2*(8-6) (10)
Q4. (a) Let X=(x1,x2,x3,……….,xn) & Y=(y1,y2,y3,…..,ym) be two linked lists . how you
will merge the two lists to obtain the linked list. How you will merge the
two lists to obtain the linked list Z=(x1,y1,x2,y2,x3,y3………,xm,ym,xm-1…..xn) if m<=n
OR Z=(x1,y1,x2,y2,x3,y3………,xn,yn,yn+1…..ym) if m>n . here x1 & y1 ‘s are information
parts. (12)
PART-B
Q5. (a) Explain the in–order method of tree traversal with recursive program. (5)
(b) What is time complexity for inserting one node into binary tree?Give
reason for answer. (5)
(c) When & Why AVL trees are preferred over binary search trees?
Build an AVL tree with following values : 11, 14,15,17,18,19,4,5,1,8. (10)
Q6. (a) What do you mean by graph traversal? Explain depth first search
algorithm. (10)
Q7.(a) Write the ‘c’ code to implement following function : void merge (int
data[] , int n1, int n2); Pre-condition: the first ‘n1’ element of data are sorted
& the next ‘n2’ elements of data are sorted(from smallest to largest).
Post-condition: the n1+n2 elements of data are now completely sorted. (5)
(b) Write algorithm for binary search . How many comparisons are required
to search ‘12’ in following list of values by using binary search algorithm: 10,
12, 15, 17, 20, 30, 40, 50, 60, 70, 80, 90? (8)
(c) How can graphs be represented in memory? (7)
(b) What is radix sort? Explain the algorithm for radix sort. (10+10)
Disclaimer: Well this looks a little stupid but we are not responsible if any portion of this paper
is not relevant with today’s syllabus. Due care has been taken to make this paper error free, but
there always remains a chance of error so please ignore any typographical error if present..