Data Structure through C Language Objective Set 1

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

Answer: a. An Integer

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

Answer: b. FIFO, First In First Out

QN3: New nodes are addes to the _______ of the queue.

a. Front

b. Back

c. Middle

d. Both 1 and

Answer

Answer: b. Back

QN4: The number of possible binary trees with 4 nodes is

a. 12

b. 13

c. 14

d. 15

Answer

Answer: c. 14

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

Answer: b. Floyd’s algorithm

QN6: 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

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

Answer: c. Both a and b

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

Answer: d. None of above

QN9: Which of the following data structure is linear data structure?

a. Trees

b. Graphs

c. Arrays

d. None of above

Answer

Answer: c. Arrays

QN10: The operation of processing each element in the list is known as

a. Sorting

b. Merging

c. Inserting

d. Traversal

Answer

Answer: d. Traversal

QN11: Value of the first linked list index is:

a. One

b. Zero

c. -1

d. None of these

Answer

Answer: b. Zero

QN12: Preorder is same as

a. depth-first order

b. breadth- first order

c. topological order

d. linear order

Answer

Answer: a. depth-first order

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

Answer: a. LIFO, Last In First Out

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

Answer: a. Queue linked list

QN15: In an array queue, data is stored in an ______ element.

a. Node

b. Linked list

c. Array

d. Constructor

Answer

Answer: c. Array

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

Answer: c. isEmpty ()

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

Answer: a. The new node is placed at the front of the linked list.

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

Answer: a. for relatively permanent collections of data

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

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

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

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

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

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

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

Answer: a. All operations are at one end

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

Answer: c. pointer-variable = malloc(sizeof(struct struct-name));

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

Answer: a. delete a;

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

Answer: d. D

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

Answer: c. Address of the first element of the array

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

Answer: d. base address

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

Answer: a. linear arrays

QN29: Two dimensional arrays are also called

a. tables arrays

b. matrix arrays

c. both of above

d. none of above

Answer

Answer: c. both of above

QN30: Which of the following data structure store the homogeneous data elements?

a. Arrays

b. Records

c. Pointers

d. None

Answer

Answer: b. Records

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

Answer: d. All of above

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

Answer: a. Sorted linked list

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

Answer: b. overflow

QN34: The situation when in a linked list START=NULL is

a. Underflow

b. overflow

c. housefull

d. saturated

Answer

Answer: a. Underflow

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

Answer: d. none of above

QN36: The term “push” and “pop” is related to the

a. Array

b. lists

c. stacks

d. all of above

Answer

Answer: c. stacks

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

Answer: a. ab + cd -*

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

Answer: c. making searching easier and efficient

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

Answer: d. Deque

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

Answer: b. FAEKCDHGB

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.