Algorithems
Algorithems
The amount of time the computer needs to run to completion is known as_____.
a.
Space complexity
b.
Time complexity
c.
Recursive function
d.
None of the above
Identify the data structure which allows deletions at both ends of the list but insertion at only
one end.
a.
Input restricted dequeue
b.
Output restricted qequeue
c.
Priority queues
d.
Stack
/ AB + CD ∗ E − F ∗∗G /
b.
AB + CD ∗ E − ∗F ∗ G /
c.
AB + CDE ∗ − ∗ F ∗ G /
d.
What data structure would you mostly likely see in a non recursive implementation of a
recursive algorithm?
a.
Stack
b.
Linked list
c.
Queue
d.
Trees
Which one of the following is the overflow condition if a circular queue is implemented using
array having size MAX?
1. rear= MAX-1
2. rear=MAX
3. front=(rear+1) mod max
4. None of the above
The necessary condition to be checked before deletion from the Queue is__
1. Overflow
2. Underflow
3. Rear value
4. Front value
Which one of the following data structures are preferred in database-system implementation?
1. AVL tree
2. B-tree
3. B+ - tree
4. Splay tree
What are the worst case and average case complexities of a binary search tree?
1. O(n), O(n)
2. O(log n), O(log n)
3. O(logn), O(n)
4. O(n), O(log n)
1. Linear Probing
2. Double hashing
3. Quadratic hashing
4. Rehashing
What is the worst case time complexity of inserting n elements into an empty linked list, if
the linked list needs to be maintained in sorted order ?
Θ(n)
Θ(n log n)
Θ(n2)
Θ(1)
Maps in C++ are implemented using which of the following data structures?
Red-Black Trees.
Binary Search Trees.
AVL Trees.
Hash Tables.
A. Dn = n log2n
B. Dn = n log2n+1
C. Dn = log2n
D. Dn = log2n+1
The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal
A. ABFCDE
B. ADBFEC
C. ABDECF
D. ABDCEF
A. O(n)
B. O(log n)
C. O(n^2)
D. O(n log n)
A. O(n)
B. O(log )
C. O(n^2)
D. O(n log n)
A. O(n)
B. O(log n)
C. O(n^2)
D. O(n log n)
B. 5
C. 10
D. 15
A. log2 n + 1
B. n
C. 2n
D. log n.
For the bubble sort algorithm, what is the time complexity of the best/worst case? (assume
2. For the quick sort algorithm, what is the time complexity of the best/worst case?
The optimal solution to a problem is a combination of optimal solutions to its subproblems. This is
known as
A. Principleof Duality
B. Principle of Feasibility
C. Principle of Optimality
D. Principle of Dynamicity.
The divide and conquer merge sort algorithm’s time complexity can be defined as
A. (long n)
B. (n)
C. Ω (n log n)
D. (n log n)
Which of the following is the most widely used external memory data structure?
a) B-tree
b) Red-black tree
c) AVL tree
d) Both AVL tree and Red-black tree
What is the time complexity for searching a key or integer in Van Emde Boas data structure?
a) O (M!)
b) O (log M!)
c) O (log (log M))
d) O (M2)
28. What is the use of the bin data structure?
a) to have efficient traversal
b) to have efficient region query
c) to have efficient deletion
d) to have efficient insertion