JNTU PAPERS

JNTU, B.Tech I Semester Data Structures Through C November 2008

( Mechanical Engineering, Mechatronics, Metallurgy &Material Technology, Production Engineering, Aeronautical Engineering and Automobile Engineering)

SET-3

1. Write a C program to find the frequency of a given word and a given character in a line of text.

2. (a) Write an algorithm which appends (concatenates) a linear list to another linear list.

(b) Write an algorithm which will perform an insertion to the immediate left of the K th node in the list.

3. Show how to implement a stack of integers by using an array int s[stack size] , where s[0] is used to contain the index of the top element of the stack and where s[1] through s[stacksize-1] contain the elements on the stack. Write declarations and routines pop, push, empty, popandtest, stacktop, and pushandtest for this implementation.

4. (a) Mention and explain various types of queues and give an example for each

(b) Compare various types of queues.

5. Write a C program for creating, inserting and deletion in a Binary tree.

6. (a) What are the advantages of adjacency matrix representation of graphs.

(b) Define spanning tree of an undirected graph.

7. (a) Using linear search delete the number 26 from the list of numbers and give the steps.

10,7,17,26,32,92

(b) Write a C program to implement the same.

8. (a) Write an algorithm for selection sort

(b) Sort the following numbers using selection sort and give the required steps.

96,31,27,42,34,76,61,10,4