Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1
IV B.Tech I Semester Supplementary Examinations, February 2007
DATA STRUCTURES THROUGH C
(Civil Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
1. Write a program to find the sum of all digits in a given number. Repeat this
operation successively until the result is a single digit. [16]
2. (a) Write a C function to add two polynomials. Do not destroy the input. Use
linked list implementations.
(b) Discuss the time complexity of your program. [16]
.
4. Give a procedure that uses a stack in order to reverse the elements of a circular
queue which are stored in an array. You may assume that call push(X)automatically
pushes the value of X onto a stack and call pop pop's a value from the stack and
assigns it to X on the other hand. [1 6]
5. (a) What is representation? Describe how a binary tree can be represented using
an array.
(b) Write C function to create and post order traversal of a binary tree [6+10]
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+8]
8. Write an algorithm for quick sort. What is its time complexity. [16]
⋆⋆⋆⋆⋆
1 of 1
Code No: RR410110 Set No. 2
IV B.Tech I Semester Supplementary Examinations, February 2007
DATA STRUCTURES THROUGH C
(Civil Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
2. (a) What is a linked list? What are the basic operations that are performed on a
linked list. Explain with the help of an example.
(b) What are the applications of linked lists? [10+4]
(a) Set ’i‘ to the second element from the top of the stack, leaving the stack
without its top two elements
(b) Given an integer n, set ‘i’ to the nth element from the top of the stack, leaving
the stack without its top n elements. [8+8]
4. (a) Mention and explain various types of queues and give an example for each
(b) Compare various types of queues. [8+8]
6. Differentiate between spanning tree and minimum spanning tree. Write a C func-
tion for minimum spanning tree. [16]
8. Write an algorithm for quick sort. What is its time complexity. [16]
⋆⋆⋆⋆⋆
1 of 1
Code No: RR410110 Set No. 3
IV B.Tech I Semester Supplementary Examinations, February 2007
DATA STRUCTURES THROUGH C
(Civil Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
1. Write a C program to find the frequency of a given word and a given character in
a line of text. [16]
3. (a) Given a sequence of push and pop operations and an integer representing the
size of an array in which a stack is to be implemented. Design an algorithm
to determine whether or not overflow occurs. The algorithm should not use a
stack.
(b) Explain what test is required for exceptional conditions in pop operations.
[8+8]
4. (a) Mention and explain various types of queues and give an example for each
(b) Compare various types of queues. [8+8]
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+8]
⋆⋆⋆⋆⋆
1 of 1
Code No: RR410110 Set No. 4
IV B.Tech I Semester Supplementary Examinations, February 2007
DATA STRUCTURES THROUGH C
(Civil Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
2. (a) What is a linked list? What are the basic operations that are performed on a
linked list. Explain with the help of an example.
(b) What are the applications of linked lists? [10+4]
3. (a) Write a ‘C’ Program to convert an infix expression into prefix expression
(b) Transform the following expression to prefix, using the approach
(A + B) ∗ (C$(D − E) + F) − G [8+8]
4. (a) Mention and explain various types of queues and give an example for each
(b) Compare various types of queues. [8+8]
5. Write a C program for creating, inserting and deletion in a Binary tree. [16]
7. (a) Using linear search delete the number 17 from the list of numbers and give
the steps.
42,12,10,91,17,59.
(b) Write a C program to implement the same. [8+8]
⋆⋆⋆⋆⋆
1 of 1