July 17, 2021 in C and CPP
Write a “C” function to implement the Knuth Mooris Pratt algorithm for string searching.
a) Write a “C” function to implement the Knuth Mooris Pratt algorithm for string searching.
July 17, 2021 in C and CPP
a) Write a “C” function to implement the Knuth Mooris Pratt algorithm for string searching.
July 17, 2021 in C and CPP
b) Write an algorithm to evaluate Postfix expression with the help of a stack.
July 17, 2021 in C and CPP
a) Write a “C” function to copy one stack to another assuming the stack is implemented using array.
July 17, 2021 in C and CPP
d) What do you mean by linear list and generalized list?
July 17, 2021 in C and CPP
c) Show the representation of linked lists using arrays.
July 17, 2021 in C and CPP
b) Show with the help of an example, how the above limitations can be avoided by “linked”
representation of lists?
July 17, 2021 in C and CPP
a) What are the limitations of array data structure?
July 17, 2021 in C and CPP
A. circular queue B. stack C. simple queue
D. band E. sparse F. many-to-many
G. one-to-many H. depth-first-search I. breadth-first search
J. log2 n K. n log2 n L. E / (n + 1)
M. Insertion N. Log2 n + 1 O. recursive
P. Compaction Q. N
4.1 Matrices in which non-zero entries tend to cluster around the middle of each row are
called __________ matrix.
4.2 A graph represents ________ relationship between nodes.
4.3 ___________ can be used to find the shortest distance between given two nodes in a
graph.
4.4 Time complexity of inserting an element to a heap of “n” elements is of the order of
_________.
4.5 If “E” is the total external length of a binary tree with “n” nodes then average number of comparisons for unsuccessful search is ________________.
4.6 _________ data structure may give overflow error, even though the current number of
elements in it is less than its size.
4.7 Conversion of infix arithmetic expression to prefix expression requires the use of
__________.
4.8 The minimum number of edges in a connected cyclic graph of “n” vertices is_________.
4.9 Linked list is preferred over an array for _________ operation.
4.10 Recursion often provides elegant solution to programming task but _______ function
chew up a lot of memory.
July 17, 2021 in C and CPP
Each statement below is either TRUE or FALSE. Choose the most appropriate one
and ENTER in the “tear-off” sheet attached to the question paper, following
instructions therein.
2.1 All primitive recursive functions can be solved iteratively.
2.2 Breadth – first search algorithm can only be used for undirected graph.
2.3 De-referencing operator * has the same effect when it is applied to a pointer or to a
structure.
2.4 Binary search performs efficiently on a linked list.
2.5 A symbol table can be constructed using binary tree.
2.6 A pre-order and post-order traversal sequence uniquely defines a tree.
2.7 If an undirected graph is of “n” vertices and “e” edges then the sum of degrees of all vertices is 2e.
2.8 The adjacency matrix corresponding to a graph consisting of “n” nodes but no edges is a
unit matrix.
2.9 Recursion cannot be removed without using a stack.
2.10 Pointers are used for dynamically allocated memory.
July 17, 2021 in C and CPP
1.10 The following sequence of operation is performed on a stack
push(1), push (2), pop, push(1), push(2), pop, pop, pop, push(2), pop.
The sequences of popped out values are
A) 2, 2, 1, 2, 1
B) 2, 2, 1, 1, 2
C) 2, 1, 2, 2, 1
D) 2, 1, 2, 2, 2