QN1: A linked list index is______ that represents the position of a node in a linked list.
a. An Integer
b. a variable
c. a character
d. a boolean
Answer: a. An IntegerAnswer
QN2:________ form of access is used to add and remove nodes from a queue.
a. LIFO, Last In First Out
b. FIFO, First In First Out
c. Both 1 and 2
d. None of these
Answer: b. FIFO, First In First OutAnswer
QN3: New nodes are addes to the _______ of the queue.
a. Front
b. Back
c. Middle
d. Both 1 and
Answer: b. BackAnswer
QN4: The number of possible binary trees with 4 nodes is
a. 12
b. 13
c. 14
d. 15
Answer: c. 14Answer
QN5: Which of the following algorithm solves the all – pair shortest path problem?
a. Dijkstra,s algorithm
b. Floyd’s algorithm
c. Prim’s algorithm
d. Warshall’s algorithm
Answer: b. Floyd’s algorithmAnswer
QN6: Finding the location of the element with a given value is:
a. Traversal
b. Search
c. Sort
d. None of above
Answer: b. SearchAnswer
QN7: The size of a structure can be determined by; a. size of variable name; b. size of (struct tag)
a. Only a
b. Only b
c. Both a and b
d. None of these options
Answer: c. Both a and bAnswer
QN8: Which of the following data structure is not linear data structure?
a. Arrays
b. Linked lists
c. Both of above
d. None of above
Answer: d. None of aboveAnswer
QN9: Which of the following data structure is linear data structure?
a. Trees
b. Graphs
c. Arrays
d. None of above
Answer: c. ArraysAnswer
QN10: The operation of processing each element in the list is known as
a. Sorting
b. Merging
c. Inserting
d. Traversal
Answer: d. TraversalAnswer
QN11: Value of the first linked list index is:
a. One
b. Zero
c. -1
d. None of these
Answer: b. ZeroAnswer
QN12: Preorder is same as
a. depth-first order
b. breadth- first order
c. topological order
d. linear order
Answer: a. depth-first orderAnswer
QN13:______ form of access is used to add and remove nodes from a stack.
a. LIFO, Last In First Out
b. FIFO, First In First Out
c. Both 1 and 2
d. None of these
Answer: a. LIFO, Last In First OutAnswer
QN14: A________ is a data structure that organizes data similar to a line in the supermarket, where the first one in line is the first one out.
a. Queue linked list
b. Stacks linked list
c. Both of them
d. Neither of them
Answer: a. Queue linked listAnswer
QN15: In an array queue, data is stored in an ______ element.
a. Node
b. Linked list
c. Array
d. Constructor
Answer: c. ArrayAnswer
QN16: The pop () member function determine if the stack is empty by calling the _______
a. member function.
b. removeback ()
c. isEmpty ()
d. removedfront ()
hasNext ()
Answer: c. isEmpty ()Answer
QN17: What happens when you push a new node onto a stack?
a. The new node is placed at the front of the linked list.
b. The new node is placed at the back of the linked list.
c. The new node is placed at the middle of the linked list.
d. No Changes happens
Answer: a. The new node is placed at the front of the linked list.Answer
QN18: Arrays are best data structures
a. for relatively permanent collections of data
b. for the size of the structure and the data in the structure are constantly changing
c. for both of above situation
d. for none of above situation
Answer: a. for relatively permanent collections of dataAnswer
QN19: Linked lists are best suited
a. for relatively permanent collections of data
b. for the size of the structure and the data in the structure are constantly changing
c. for both of above situation
d. for none of above situation
Answer: b. for the size of the structure and the data in the structure are constantly changingAnswer
QN20: Each array declaration need not give, implicitly or explicitly, the information about-
a. the name of array
b. the data type of array
c. the first data from the set to be stored
d. the index set of the array
Answer: c. the first data from the set to be storedAnswer
QN21: The elements of an array are stored successively in memory cells because
a. By this way computer can keep track only the address of the first element and the addresses of other elements can be calculated
b. the architecture of computer memory does not allow arrays to store other than serially
c. both of above
d. none of above
Answer: a. By this way computer can keep track only the address of the first element and the addresses of other elements can be calculatedAnswer
QN22: Which of the following is the feature of stack?
a. All operations are at one end
b. It cannot reuse its memory
c. All elements are of different data types
d. Any element can be accessed from it directly
Answer: a. All operations are at one endAnswer
QN23: To create a linked list, we can allocate space and make something point to it, by writing:
a. struct-name *pointer-variable. Which of the following statement will correctly allocate the space
b. pointer-variable = malloc(sizeof(*struct-name));
c. pointer-variable = malloc(sizeof(struct struct-name));
d. pointer-variable = alloc(sizeof(struct struct-name));
pointer-variable = alloc(sizeof(*struct-name
Answer: c. pointer-variable = malloc(sizeof(struct struct-name));Answer
QN24: To delete a dynamically allocated array named `a`, the correct statement is
a. delete a;
b. delete a[0];
c. delete []a;
d. delete [0]a;
Answer: a. delete a;Answer
QN25: The five items: A, B, C, D and E are pushed in a stack, one after the other starting from A. The stack is popped four times and each element is inserted in a queue. Then two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is
a. A
b. B
c. C
d. D
Answer: d. DAnswer
QN26: Array passed as an argument to a function is interpreted as
a. Address of the array
b. Values of the first elements of the array
c. Address of the first element of the array
d. Number of element of the array
Answer: c. Address of the first element of the arrayAnswer
QN27: The memory address of the first element of an array is called
a. Floor address
b. foundation address
c. first address
d. base address
Answer: d. base addressAnswer
QN28: Which of the following data structures are indexed structures?
a. linear arrays
b. linked lists
c. both of above
d. none of above
Answer: a. linear arraysAnswer
QN29: Two dimensional arrays are also called
a. tables arrays
b. matrix arrays
c. both of above
d. none of above
Answer: c. both of aboveAnswer
QN30: Which of the following data structure store the homogeneous data elements?
a. Arrays
b. Records
c. Pointers
d. None
Answer: b. RecordsAnswer
QN31: The difference between linear array and a record is
a. An array is suitable for homogeneous data but the data items in a record may have different data type
b. In a record, there may not be a natural ordering in opposed to linear array
c. A record form a hierarchical structure but a linear array does not
d. All of above
Answer: d. All of aboveAnswer
QN32: Binary search algorithm can not be applied to
a. Sorted linked list
b. sorted binary trees
c. sorted linear array
d. pointer array
Answer: a. Sorted linked listAnswer
QN33: When new data are to be inserted into a data structure, but there is no available space; this situation is usually called
a. underflow
b. overflow
c. housefull
d. saturated
Answer: b. overflowAnswer
QN34: The situation when in a linked list START=NULL is
a. Underflow
b. overflow
c. housefull
d. saturated
Answer: a. UnderflowAnswer
QN35: Which of the following is two-way list?
a. Grounded header list
b. circular header list
c. linked list with header and trailer nodes
d. none of above
Answer: d. none of aboveAnswer
QN36: The term “push” and “pop” is related to the
a. Array
b. lists
c. stacks
d. all of above
Answer: c. stacksAnswer
QN37: The postfix equivalent of the prefix * + a b – c d is
a. ab + cd -*
b. ab cd + – *
c. ab + cd * –
d. ab + – cd *
Answer: a. ab + cd -*Answer
QN38: Sorting is useful for
a. Report generation
b. Minimizing the storage needed
c. making searching easier and efficient
d. Responding to queries easily
Answer: c. making searching easier and efficientAnswer
QN39: A data structure where elements can be added or removed at either end but not in the middle
a. Linked lists
b. Stacks
c. Queues
d. Deque
Answer: d. DequeAnswer
QN40: When in order traversing a tree resulted E A C K F H D B G; the preorder traversal would return
a. FAEKCDBHG
b. FAEKCDHGB
c. EAFKHDCBG
d. FEAKDCHBG
Answer: b. FAEKCDHGBAnswer