Ce 317
Ce 317
:___________________
RK UNIVERSITY
B.TECH./SEM-III/SUPPLEMENTARY/DEC.-2018
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Programmable calculator is not permissible.
SECTION – I
Q.1 (a) Select the most appropriate option: (Each of one mark) 06
1. Which of the following data structure is not linear?
a. Stack
b. Array
c. Queue
d. Tree
2. What are the advantages of arrays?
a. Easier to store elements of same data type
b. Used to implement other data structures like stack and queue
c. Both (a) and (b)
d. None of these
3. Which of the following applications may use a stack?
a. Checking balanced parenthesis
b. Evaluation of postfix expression
c. Reverse operation
d. All of these
4. The following sequence of operation is performed on stack.
push(1), push(2), pop, push(1), push(2), pop, pop, pop, push(2), pop.
The sequence of popped out values are?
a. 2,2,1,1,2
b. 2,2,1,2,2
c. 2,1,2,2,1
d. 2,1,2,2,2
5. In linked list each node contains minimum two fields. One field is
data field to store the data second field is?
a. Pointer to character
b. Pointer to integer
c. Pointer to node
d. None of these
Page 1 of 4
6. Queue is ______ data structure.
a. Last in first out
b. First in first out
c. Both (a) and (b)
d. None of these
Q.2 (a) Convert given infix expressions to the postfix expressions with stack 06
trace: (A+B)*D+E/(F+G*D)+C
(b) Write a recursive algorithm to find factorial. 05
(c) Demonstrate use of stack in reverse operation with example. 05
OR
Q.2 (a) Write an algorithm to implement insert operation into a Circular 06
Queue using array representation of Queue.
(b) Create a C function to display total number of nodes in a singly 05
linked list.
(c) Write an algorithm for inserting a node and deleting a node in 05
doubly linked list.
Q.3 (a) Define “Stack”. Also write algorithm / UDF for PUSH and POP 06
operations.
(b) Write an algorithm to delete an element from singly linked list. 06
(c) What is node? How to represent node in C programming language? 06
Also write code to insert new node at beginning of the linked list.
OR
Q.3 (a) Define “Queue”. Also write algorithm / UDF for INSERT and 06
DELETE operations.
(b) Write an algorithm to insert an element at the middle position in a 06
circular linked list.
(c) Write algorithm / program to insert new node at the end of linked 06
list.
Page 2 of 4
SECTION – II
Q.4 (a) Select the most appropriate option: (Each of one mark) 06
1. Binary trees can have how many children?
a. 2
b. 0 or 1 or 2
c. 0 or 1
d. 1
2. Which of the following is true about a binary search tree?
a. The left child is always lesser than its parent
b. The right child is always greater than its parent
c. Both (a) and (b)
d. None of these
3. Height of complete binary tree is
a. H = O(log n)
b. H = O(n)
c. H = O(n*H)
d. H = O(n log n)
4. The number of elements in the adjacency matrix of a graph having 5
vertices is
a. 16
b. 36
c. 49
d. 25
5. Which of the following terminology is not related to tree?
a. Root node
b. Leaf node
c. Parent node
d. Public node
6. Which of the following searching algorithm is better?
a. Linear search
b. Binary search
c. Both (a) and (b)
d. None of these
Page 3 of 4
Q.5 (a) Draw BST for given sequence 50, 40, 60,30,55,70,65,82,92. After 06
creation of BST insert new node 95 in tree and delete 82 from list.
(b) Write an algorithm / implementation of binary search. 05
(c) Explain matrix and Adjacency list representation of a graph with 05
suitable example.
OR
Q.5 (a) Construct BST on given traversal technique. 06
Preorder: G,B,Q,A,C,K,F,P,D,E,R,H
Inorder: Q,B,K,C,F,A,G,P,E,D,H,R
(b) Explain selection sort with suitable example. 05
(c) Write an algorithm of Linear Search. 05
*************
Page 4 of 4