QN1. 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
QN2. 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
QN3. Which of the following is not the required condition for binary search algorithm?
a.) The list must be sorted
b.) there should be the direct access to the middle element in any sublist
c.) There must be mechanism to delete and/or insert elements in list
d.) none of above
Answer: c.) There must be mechanism to delete and/or insert elements in listAnswer
QN4. Which of the following is not a limitation of binary search algorithm?
a.) must use a sorted array
b.) requirement of sorted array is expensive when a lot of insertion and deletions are needed
c.) there must be a mechanism to access middle element directly
d.) binary search algorithm is not efficient when the data elements are more than 1000.
Answer: d.) binary search algorithm is not efficient when the data elements are more than 1000.Answer
QN5. Two dimensional arrays are also called
a.) tables arrays
b.) matrix arrays
c.) both of above
d.) none of above
Answer: b.) matrix arraysAnswer
QN6. A variable P is called pointer if
a.) P contains the address of an element in DATA,
b.) P points to the address of first element in DATA
c.) P can store only memory addresses
d.) P contain the DATA and the address of DATA
Answer: a.) P contains the address of an element in DATA,Answer
QN7. Which of the following data structure can’t store the non-homogeneous data elements?
a.) Arrays
b.) Records
c.) Pointers
d.) None
Answer: a.) ArraysAnswer
QN8. Which of the following data structure store the homogeneous data elements?
a.) Arrays
b.) Records
c.) Pointers
d.) None
Answer: b.) RecordsAnswer
QN9. 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
QN10. Which of the following statement is false?
a.) Arrays are dense lists and static data structure
b.) data elements in linked list need not be stored in adjacent space in memory
c.) pointers store the next data element of a list
d.) linked lists are collection of the nodes that contain information part and next pointer
Answer: c.) pointers store the next data element of a listAnswer
QN11. 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
QN12. 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
QN13. The situation when in a linked list START=NULL is
a.) underflow
b.) Overflow
c.) Housefull
d.) saturated
Answer: a.) underflowAnswer
QN14. 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
QN15. Which of the following name does not relate to stacks?
a.) FIFO lists
b.) LIFO list
c.) Piles
d.) Push-down lists
Answer: a.) FIFO listsAnswer
QN16. The term “push” and “pop” is related to the
a.) array
b.) Lists
c.) Stacks
d.) All of above
Answer: c.) StacksAnswer
QN17. 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
QN18. When in order traversing a tree resulted EACKFHDBG; the preorder traversal would return
a.) FAEKCDBHG
b.) FAEKCDHGB
c.) EAFKHDCBG
d.) FEAKDCHBG
Answer: b.) FAEKCDHGBAnswer
QN19. The complexity of linear search algorithm is
a.) 0(n)
b.) O(logn)
c.) 0(n2)
d.) 0(nlogn]
Answer: a.) 0(n)Answer
QN20. The complexity of Binary search algorithm is
a.) O(n)
b.) O(log n]
c.) O(n2]
d.) O(n log n]
Answer: b.) O(log n]Answer
QN21. The complexity of Bubble sort algorithm is
a.) O(n)
b.) O(log n)
c.) O(n2)
d.) O(n log n]
Answer: c.) O(n2)Answer
QN22. The complexity of merge sort algorithm is
a.) O(n)
b.) O(log n]
c.) O(n2)
d.) O(n log n)
Answer: d.) O(n log n)Answer
QN23. The indirect change of the values of a variable in one module by another module is called
a.) internal change
b.) inter-module change
c.) side effect
d.) side-module update
Answer: c.) side effectAnswer
QN24. 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
QN25. Which of the following data structure is linear data structure?
a.) Trees
b.) Graphs
c.) Arrays
d.) None of above
Answer: c.) ArraysAnswer
QN26. The operation of processing each element in the list is known as
a.) Sorting
b.) Merging
c.) Inserting
d.) Traversal
Answer: d.) TraversalAnswer
QN27. Finding the location of the element with a given value is:
a.) Traversal
b.) Search
c.) Sort
d.) None of above
Answer: b.) SearchAnswer
QN28. 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
QN29. 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
QN30. 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
QN31. 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
QN32. In a Stack the command to access nth element from the top of the stack s will be
a.) S[Top-n]
b.) S [Top+n] c.) S [top-n-1]
d.) None of the above
Answer: a.) S[Top-n]Answer
QN33. In a balance binary tree the height of two sub trees of every node can not differ by more than
a.) 2
b.) 1
c.) 0
d.) 3
Answer: b.) 1Answer
QN34. The result of evaluating prefix expression */b+-dacd, where a = 3, b = 6, c = 1, d = 5 is
a.) 0
b.) 5
c.) 10
d.) 15
Answer: c.) 10Answer
QN35. In an array representation of binary tree the right child of root will be at location of
a.) 2
b.) 5
c.) 3
d.) 0
Answer: c.) 3Answer
QN36. What is the postfix expression for the following infix: (a + b*(c – a) – d)
A. d b c a-*a + –
B. a b c a d–* +
C. a b c a-* + d-
D. None of the above.
Answer: C. a b c a-* + d-Answer
QN37. What is the value of the postfix expression 6 3 2 4- + *
A. Something between-15 and-100
B. Something between -5 and -15
C. Something between 5 and -5
D. Something between 5 and 15
E. Something between 15 and 100
Explanation: exact value is 6 which is equivalent to option D.
Answer: D. Something between 5 and 15Answer
QN38. One difference between a queue and a stack is:
A. Queues require linked lists, but stacks do not
B. Stacks require linked lists, but queues do not
C. Queues use two ends of the structure; stacks use only one.
D. Stacks use two ends of the structure, queues use only one.
Answer: C. Queues use two ends of the structure; stacks use only one.Answer
QN39. For the following tree, what is the order of nodes visited using an in-order traversal?
A. 12 3 7 10 111430 40
B. 12 3 14 7 10 1140 30
C. 13 2 7 10 40 30 1114
D. 142 13 1110 7 30 40
Answer: B. 12 3 14 7 10 1140 30Answer
QN40. Given a binary tree with 18 nodes, what is the minimum possible depth of the tree?
A. 1
B. 2
C. 3
D. 4
E. 5
Answer: D. 4Answer