mcq quizack
mcq quizack
What compares adjacent elements and exchanges them to put an array in order?
Insertion sort
Selection sort
Quicksort
Bubble sort✔
Which represents data as a chain of nodes and provides dynamic growth of data?
Stack
Linked List✔
Sequence
Array
Queue
Array
Stack
Linked List✔
Which is the most suitable data structure for hierarchical data models?
Priority Queue
Linked List
Tree✔
Array
Lower bound✔
Upper bound
Midpoint
Range
What is the process a procedure goes through when one of the steps of the
procedure involves invoking the procedure itself?
Induction
Recursion✔
Sequencing
Looping
Yes✔
No
What is the most suitable data structure for a situation where tasks must be
scheduled for execution on a computer and the tasks include system tasks?
Tree
Array
Linked List
Priority Queue✔
One.
Two. One queue is used for actual storing of data and another for storing priorities. ✔
Three.
Four.
What is the difference between the stack and queue data structures?
A(n) ______ is the data structure used more than any other data structure.
Binary Tree
Array✔
Linked List
B-tree
The most common solution to the Towers of Hanoi involves the use of which data
structure
Hash table
Set
Stack✔
Queue
Sorting algorithms
Searching algorithms✔
computational complexity measurements
Stack
Binary tree
Queue✔
Array
What is the running time of finding Nth element in array using quick sort? (For
example: Find the 4th smallest element in an unsorted array.)
n!
2^n
n * log(n)✔
n^3
n^2
False✔
True
Deletion of a leaf✔
Creation of a list
Insertion of a node
Deletion of a node
What is the data structure used to perform recursion?
Array
Binary Tree
B-tree
Stack✔
O(N^2)
It depends on how both N and M vary.
O(N*M)✔
O(N+M)
In tree there may be more than one path from root to leaf node
False✔
True
The path length from root to farthest leaf node is the ______ of the tree.
Set
Height
Size
Depth✔
O(n^2)
O (1)
O (log n)
O(n)✔
Which is a way of organizing data that considers not only the items stored, but also
their relationship to each other?
Database table
Algorithm
Database
Data Structure✔
O(NlogN)✔
O(N*N)
O(1)
O(logN)
O(N)
The path length from a node to the deepest leaf under it is the ---.
Size
Height✔
Depth
Set
What happens if you make a recursive call without making the problem smaller?
The operating system detects the infinite recursion because of the "repeated state"
The program keeps running until you press Ctrl-C
The results are non-deterministic
The run-time stack overflows, halting the program✔
The operation for adding an entry to a stack is traditionally called ________.
add
append
insert
push✔
0
1
2✔
3
In which data structure do the insertion and deletion take place at the same end?
Linked list
Tree
Stack✔
Linked list of stacks
In which dynamically created linked list can the first node be recovered after moving
to the second node?
abc-+de-fg+h-/*
*+a-bc/-de-+f-gh✔
a+*b-/c-d-e+fgh
*+a-bc-/d+e-fgh
What is the maximum number of statements that may be recursive calls in a single
function declaration?
1
2
n (n is the argument)
There is no fixed maximum✔
O(log n)
O(n)
O(n log n)✔
O(n2)
T(n)=O(nm)
T(n)=O(m*log(m))
T(n)=O(n*log(m))✔
T(n)=O(m*log(n))
Consider a linked list of n elements which is pointed by an external pointer. What is
the time taken to delete the element which is a successor of the pointed element by
a given pointer?
O(1)✔
O(log2n)
O(n)
O(n*log2n)
The linked list implementation of sparse matrices is superior to the generalized dope
vector method because it is __________.
Where does the push member function place the new entry on the linked list in the
linked list implementation of a queue?
At the head
At the tail✔
After all other entries that are greater than the new entry
After all other entries that are smaller than the new entry
Constant
Linear✔
Logarithmic
Quadratic
Consider a linked list implementation of a queue with two pointers: front and rear.
The time needed to insert element in a queue of length n is:
O(1)✔
O(log2n)
O(n)
O(n*log2n)
You have implemented a queue with a circular array keeping track of the first, the
last, and the count (the number of items in the array). Suppose the first is zero, and
the last is CAPACITY-1, what can you say about the count?
State whether True or False. For all possible inputs, a linear algorithm to solve a
problem must perform faster than a quadratic algorithm to solve the same problem.
True✔
False
If a max heap is implemented using a partially filled array called data, and the array
contains n elements (n > 0), where is the entry with the greatest value?
data[0]✔
data[n-1]
data[n]
data[2*n + 1]
Which of the following lines of the code will delete two successive nodes of a single
linked linear list(with more than two nodes)? Here 'LINK[X]' denotes the address field
of node X.
LINK[X]:=LINK[LINK[X]]
X:=LINK[LINK[X]]
LINK[LINK[X]]:=X
LINK[X]:=LINK[LINK[LINK[X]]]✔
Which operations require linear time for their worst-case behavior in the linked-list
version of a queue?
front
push
empty✔
None of these operations require linear time
Which of the operations is simpler in the doubly linked list than it is in the simple
linked list?
Insertion
Deletion
Both a and b✔
None of the above
Which of the following formulae in big-Oh notation best represents the expression
n2+35n+6?
O(n3)
O(n2)✔
O(n)
O(42)
The operation for removing an entry from a stack is traditionally called _______.
delete
peek
pop✔
remove
Simple queue
Circular queue✔
Dequeue
Special queue
You have implemented a queue with a linked list keeping track of a front pointer
and a rear pointer. Which of these pointers will you change during an insertion into
a NONEMPTY queue?
Which of the following operations is performed more efficiently by the doubly linked
list than by the linear linked list?
Four characters are placed in a queue in the following order: D, C, B, and A. If they
are removed one at a time, what will be the order of their removal?
ABCD
ABDC
DCAB
DCBA✔
Which of the following operations in the simple linked list will modify the beginning
of the linked list?
What will happen if in data structure a pop operation on the stack causes the stack
pointer to move past the origin of the stack?
Overflow
Underflow✔
Null
Garbage collection
Push, delete
Insert, pop
Put, extract
Push, pop✔
Suppose we have a circular array implementation of a queue, with ten items in the
queue stored at data[2] through data[11]. The CAPACITY is 42. Where does the
enqueue member function place the new entry in the array?
data[1]
data[2]
data[11]
data[12]✔
You have implemented a queue with a linked list keeping track of a front pointer
and a rear pointer. Which of these pointers will you change during an insertion in
the middle of a NONEMPTY queue?
What kind of list is the best to answer questions such as "Which is the item at
position n?"