Sunteți pe pagina 1din 7

Data Structures Using C Viva Questions

Answer the following

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ?

2) Which data structure is needed to convert infix notations to postfix notations?

3) The infix expression A+((B-C)*D) is correctly represented in prefix notation as ?

4) A list of data items usually words or bytes, with the accessing restriction that elements can be
added or removed at one end of the list only, is known as ?

5) In what order the elements of a push down stack are accessed ?

6) The following sequence of operations performed on a stack push (1), push (2), pop, push (1),
push (2), pop, pop, pop, push (2), pop. The sequence of popped out values are ?

7) The postfix form of A$B * C-D + E/F/(G+H) is ?

8) The postfix form of A-B/(C*D$E) is ?

9) The prefix form of A-B/(C*D$E) is ?

10) The prefix of (A+B)*(C-D) is ?

11) What is a Base case?

12) What is a Recursive case?

13) What will be the value returned by the following function when it is called with 11.

recur (int num) {


if((num/2)!=0)
return(recur(num/2)*10+num%2);
else
return 1;
}

14) A linear list in which elements can be added or removed at either end but not in the middle is
known as ?

15) The initial configuration of queue is a, b, c, d (‘a’ is at the front). To get the configuration d, c, b,
a one needs a minimum of?

16) Queues serve a major role in ?

17) Queue ?

18) Let P be the queue of integers defined as follows-


#define MAXQ 500
struct queue {
int items [MAXQ];
int front, rear;
}q;

Mr. Shylesh B C Page 1 of 7


Data Structures Using C Viva Questions

To insert an elements in the queue we can use?

19) Implementation of list in a dynamic fashion is ?

20) Because of linear structure of linked list having natural linear ordering, there is similarity
between linked list and array in?

21) Header of a linked list is a special node at the ?

22)struct address { char name [40]; struct address *next }info;

func(struct address *j ) {
static struct address *i =0;
if (i==0) i= j;
else i ->next = j;
j -> next =0;
i =j;
}
builds the linked list by placing each element ?

23) struct address { char name [40]; struct address *next }info;
func (struct address *head) {
while (head) {
printf (head ->name);
head = head -> next;}
}
prints the?

24) In linked list the logical order of elements : ?

25) The nth node in singly linked list is accessed via ( where n > 1 ) : ?

26) In linked list the successive elements : ?

27) Linear order in linked list is provided through : ?

28) NULL pointer is used to tell : ?

29) List pointer variable in linked list contains address of the : ?

30) Underflow condition in linked list may occur when attempting to : ?

31) Deletion of a node in linked list involves keeping track of the address of the node : ?

32) Having address of the node to be deleted in double linked list, the node can be deleted:?

33) Appropriate data structure in C to represent linked list is : ?

34) Link of linked list in C is of type : ?

35) malloc function returns NULL value when : ?

Mr. Shylesh B C Page 2 of 7


Data Structures Using C Viva Questions

36) Previously allocated memory can be returned to the system by using : ?

37) Function /s associated with dynamic memory allocation is : ?

38) How many ancestors does a node in the Nth level (root level =0) of a binary search tree have?

39) A binary search tree is generated by inserting in order the following integers : 50, 15, 62, 5,
20, 58, 91, 3, 8, 37, 60, 24. The number of nodes in the left subtree and right subtree of the root
respectively is ?

40) Which process is faster for threaded trees compared with their unthreaded counterparts ?

41) If a binary tree is threaded for an in order traversal order, NULL left link of any node is replaced
by the address of its : ?

42) The inorder traversal of some binary tree produced the sequence DBEAFC, and the postorder
traversal of the same tree produced the sequence DEBFCA. What is the preorder traversal sequence?

43) A balanced binary tree is a binary tree in which the heights of the two subtrees of every node
never differ by more than :?

44) The postorder traversal of some binary tree produced the sequence CDBFEA, and the inorder
traversal of the same tree produced the sequence CBDAFE. What will be the total number of nodes in
its right sub tree :?

45) The postorder traversal of some binary tree produced the sequence CDBFEA, and the inorder
traversal of the same tree produced the sequence CBDAFE. What will be the total number of nodes in
its left sub tree :?

46) The inorder traversal of some binary tree produced the sequence CBDA, and the postorder
traversal of the same tree produced the sequence CDBA. Then ?

47) In view of a complete binary tree what is the value of the outdegree - ?

48) Balance of the node : ?

49) Level of any node of a tree is : ?

50) The element at the root of the heap is ?

51) Bubble sort does not use ?

52) Name the sort in which array to be sorted is partitioned again and again in such a way that all
elements less than or equal to partition element appear before it and those which are greater appear
after it. ?

52) This sort inserts each elements A(k) into its proper position in the previously sorted subarray
A(1), …. A(k-1). ?

53) In this sort file is divided into subfiles which are to be independently sorted and then merged : ?

Mr. Shylesh B C Page 3 of 7


Data Structures Using C Viva Questions

54) Average case time complexity of the quick sort algorithm is more than :?

55) For sorting contiguous list of records quicksort may be preferred over merge sort because : ?

56) In quicksort a desirable choice for the partitioning element will be :?

57) The techniques used in creating hash keys are -?

58) In this search keys must be ordered : ?

59) The searching method requires that all keys must reside in internal memory : ?

60) The element being searched for is not in an array of 100 elements. What is the average number
of comparisons needed in a sequential search to determine that the element is not there if the
elements are completely unordered. ?

61) The element being searched for is not in an array of 100 elements. What is the average number
of comparisons needed in a sequential search to determine that the element is not there if the
elements are ordered from smallest to largest?

62) The element being searched for is not in an array of 100 elements. What is the average number
of comparisons needed in a sequential search to determine that the element is not there if the
elements are ordered from largest to smallest?

63) The element being searched for is not in an array of 100 elements. What is the average number
of comparisons needed in a sequential search to determine the position of the if the elements are
completely unordered?

State whether the following statements are TRUE or FALSE :

1) A stack may be represented by a linear linked list.

2) Push operation in stack is performed at the rear end -

3) Only the most recently inserted element can be accessed through POP operation in stack-

4) POP operation in stack may result in overflow -

5) PUSH operation in stack may result in underflow -

6) Stack is an example of linear list -

7) Recursive function must be called directly -

8) In many cases we observe that, a recursive solution is the most natural and logical way of solving
problem. -

9) The problem of Tower of Hanoi is very difficult to solve using non recursive process. -

10) Recursive functions and iterative functions using stacks can accomplish exactly the same tasks. -

11) The number of total elements in a queue is fixed. -

Mr. Shylesh B C Page 4 of 7


Data Structures Using C Viva Questions

12) The number of elements in a queue, at any time is : q.rear – q.front - 1. -

13) The operation of removing an element from a queue logically, involves manipulation of only one
element. -

14) The term head of the queue is same as the term front of the queue. -

15) Queue can be created by setting up am ordinary contiguous array to hold the items. -

16) The concept of circular array is very difficult to implement. -

17) For stack or queue,a arbitrary amount of memory can be allocated. -

18) FRONT = REAR pointer means queue is empty. -

19) A Queue can be implemented using a circular array with front and rear indices and one position
left vacant. -

20) Queue is an useful data structure for any simulation applications. -

21) A Priority queue is implemented using an array of stacks. -

22) List NULL can be used to initialize list as empty list -

23) In linked list the logical order of elements is same as their physical arrangement -

24) Random access of elements in linked list is possible -


25) In linked list each node must have atleast two fields -

26) In linked list successive elements need not occupy adjacent space in memory. -

27) Searching the linked list requires the list must be in sorted order -

28) Every tree can be uniquely represented by a binary tree.

29) Tree traversal is a procedure by which, each node in the tree is processed exactly twice in a
systematic manner

30) In preorder traversal of a binary tree the left subtree is traversed after processing the root node.

31) In preorder traversal of a binary tree the root node is processed first.

32) For inorder traversal of a binary tree the inorder traversal of its left subtree should be performed
first.

33) A binary tree is threaded according to a particular traversal order.

34) For inorder threading of a binary tree if the left link of some node is NULL it is replaced by the
address of its successor.

35) The height of a binary tree is the maximum level of its leaves.

36) In a tree a node with no sub trees is called a leaf node.

Mr. Shylesh B C Page 5 of 7


Data Structures Using C Viva Questions

37) The level of any node of a tree is the length of its path from the root.

38) The level of the root node of any tree is 1.

39) In internal sorting methods it is necessary for all data to reside in internal memory

40) Insertion sort is also called bubble sort

41) In merge sort, files to be merged must be sorted

42) Quick sort and merge sort are example of divide and conquer algorithms

43) Insertion sort is O(N)

44) Average case time for quick sort is O(log n )

45) Bubble sort algorithm requires O(N) comparisons for sorting a sorted list

46) Quick sort algorithm requires O(N log N) comparisons for sorting a sorted list

47) A Heap need not be a binary tree

48) Merge sort is a stable sorting algorithm

49) For sorting elements of an array, where each element is a large record, it is always desirable to
use an index array for reducing overhead of comparison.

50) Radix search algorithms work with bits or components of the keys instead of the complete keys.

51) A binary search of an ordered set of elements in an array is always faster than a sequential
search of the elements :

52) A binary search is an O ( N log2 N ) algorithm :

53) A binary search of elements in an array requires that the elements be sorted from smallest to
largest

54) When a hash function is used to determine the placement of elements in an array, the order in
which the elements are added will not affect the resulting array :

55) When hashing is used, increasing the size of the array will always reduce the number of
collisions.

56) No. of elements in the linear Queue with pointers REAR & FRONT at any given instant can be
given by formula - ?

57) If n is the size of array, maximum no. of elements that can be stored in the circular queue is?

58) The property of which data structure matches with that of Priority queue?

59) If a doubly linked list is I/P restricted as well as O/P restricted, the queue become ?

Mr. Shylesh B C Page 6 of 7


Data Structures Using C Viva Questions

60) The use of free() function in C requires the header file declaration ?

61) malloc(sizeof(int[10])) The pointer that can point to the above defined m/y area is?

62)Minimum no of pointer adjustment for deletion of any node from the circular doubly linked list is
?

63) sizeof () is ?

64) The overflow condition in the array implementation of linked list may occur while calling to ?

65) Struct book


{
int acc_no;
char title[20];
float price;
};
struct book *s;

sizeof (*s) will give ?

66) What is the purpose of using header nodes in the linked?

67) Which function will require the concept of previous node pointer (for linear linked list): ?

68) Using C language to implement the heterogeneous linked list, what may be the different pointer
types?

69) Minimum number of queues needed to implement the priority queue is?

70) The queue data structure follows the order ?

Mr. Shylesh B C Page 7 of 7

S-ar putea să vă placă și