Data Structure through C Language Objective Set 2

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

Answer: d.) base address

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

Answer: a.) linear arrays

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

Answer: c.) There must be mechanism to delete and/or insert elements in list

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

Answer: d.) binary search algorithm is not efficient when the data elements are more than 1000.

QN5. Two dimensional arrays are also called

a.) tables arrays

b.) matrix arrays

c.) both of above

d.) none of above

Answer

Answer: b.) matrix arrays

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

Answer: a.) P contains the address of an element in DATA,

QN7. Which of the following data structure can’t store the non-homogeneous data elements?

a.) Arrays

b.) Records

c.) Pointers

d.) None

Answer

Answer: a.) Arrays

QN8. Which of the following data structure store the homogeneous data elements?

a.) Arrays

b.) Records

c.) Pointers

d.) None

Answer

Answer: b.) Records

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

Answer: d.) All of above

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

Answer: c.) pointers store the next data element of a list

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

Answer: a.) sorted linked list

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

Answer: b.) overflow

QN13. The situation when in a linked list START=NULL is

a.) underflow

b.) Overflow

c.) Housefull

d.) saturated

Answer

Answer: a.) underflow

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

Answer: d.) none of above

QN15. Which of the following name does not relate to stacks?

a.) FIFO lists

b.) LIFO list

c.) Piles

d.) Push-down lists

Answer

Answer: a.) FIFO lists

QN16. The term “push” and “pop” is related to the

a.) array

b.) Lists

c.) Stacks

d.) All of above

Answer

Answer: c.) Stacks

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

Answer: d.) Deque

QN18. When in order traversing a tree resulted EACKFHDBG; the preorder traversal would return

a.) FAEKCDBHG

b.) FAEKCDHGB

c.) EAFKHDCBG

d.) FEAKDCHBG

Answer

Answer: b.) FAEKCDHGB

QN19. The complexity of linear search algorithm is

a.) 0(n)

b.) O(logn)

c.) 0(n2)

d.) 0(nlogn]

Answer

Answer: a.) 0(n)

QN20. The complexity of Binary search algorithm is

a.) O(n)

b.) O(log n]

c.) O(n2]

d.) O(n log n]

Answer

Answer: b.) O(log n]

QN21. The complexity of Bubble sort algorithm is

a.) O(n)

b.) O(log n)

c.) O(n2)

d.) O(n log n]

Answer

Answer: c.) O(n2)

QN22. The complexity of merge sort algorithm is

a.) O(n)

b.) O(log n]

c.) O(n2)

d.) O(n log n)

Answer

Answer: d.) O(n log n)

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

Answer: c.) side effect

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

Answer: d.) None of above

QN25. Which of the following data structure is linear data structure?

a.) Trees

b.) Graphs

c.) Arrays

d.) None of above

Answer

Answer: c.) Arrays

QN26. The operation of processing each element in the list is known as

a.) Sorting

b.) Merging

c.) Inserting

d.) Traversal

Answer

Answer: d.) Traversal

QN27. Finding the location of the element with a given value is:

a.) Traversal

b.) Search

c.) Sort

d.) None of above

Answer

Answer: b.) Search

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

Answer: a.) for relatively permanent collections of data

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

Answer: b.) for the size of the structure and the data in the structure are constantly changing

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

Answer: c.) the first data from the set to be stored

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

Answer: a.) by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated

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

Answer: a.) S[Top-n]

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

Answer: b.) 1

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

Answer: c.) 10

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

Answer: c.) 3

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

Answer: C. a b c a-* + d-

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

Answer: D. Something between 5 and 15

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

Answer: C. Queues use two ends of the structure; stacks use only one.

QN39. For the following tree, what is the order of nodes visited using an in-order traversal?

word image 958

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

Answer: B. 12 3 14 7 10 1140 30

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

Answer: D. 4

ed010d383e1f191bdb025d5985cc03fc?s=120&d=mm&r=g

DistPub Team

Distance Publisher (DistPub.com) provide project writing help from year 2007 and provide writing and editing help to hundreds student every year.