CS-62 C Programming And Data Structure Dec- 2004
Question Paper of CS-62 C Programming And Data Structure Dec- 2004
Q.l(a) Represent a polynomial using a circularly inked list. Write an algorithm to subtract two polynomials using the representation above. What is the time complexity of your algorithm to subtract two polynomials using the representation above. What is the time complexity of your algorithm ?
(b) A file stores a series of numbers. Write an algorithm using binary search tree that counts the occurrence of different numbers in the file. For example, file containing data 1, 50, 20, 1, 25 would produce output as
Number Occurrence
1 2
20 1
25 1
50 1
© Write an algorithm to sort a sequence of number of numbers in increasing order using bubble sort. What is the time complexity of this algorithm ?
(d) What are the various applications of stacks and queues ? Give at least two applications of each.