Algorithms and Data Structures
English
Intermediate
This is a Multiple Choice Questions (MCQs) based on Data Structures and Algorithms, where you will be given four options.
Description
Data structures, Algorithms, Trees, Graphs, Arrays, Heaps, Queues, Stacks, Computer science, Interview
Tags
35
Questions
30 sec
Per question
8:57
Average time
Disqualified
Contest Score
3.3
Community Rating
403
Participants
Unfortunately, this test will not be able to receive a prize:
Not an original test. Some questions were copied from other sources. E.g.
#q1 "What will be the running-time of Dijkstra's single source shortest path algorithm, if the graph G(V,E) is stored in form of adjacency list and binary heap is used?" <= https://compscibits.com/Data-Structures-and-Algorithms/Graphs/discussion/4120
#q2 "Which of the following has search effeciency of Ο(1)?" <= https://compscibits.com/Data-Structures-and-Algorithms/Sorting-and-Searching/discussion/4070, etc.
Just a small remark, for some questions (Q17, Q23) about the operations with stack, 30 seconds is not enough.
Consider you have a stack whose elements in it are as follows.
5 4 3 2 << top
Where the top element is 2. You need to get the following stack 6 5 4 3 2 << top The operations that needed to be performed are (You can perform only push and pop):
Your answer is Push(pop()), push(6), push(pop()).
pop() deletes and returns the top element of stack. push(x) adds element x to the top of stack. So push(pop()) simply does nothing with stack. This answer is incorrect.
What will be result if the given stack is popped?
S
E R
Your answer is S E R.
Here is the same, pop() returns the top element of stack, so result will be S.
If we're using a stack, what are the set of functions that are to be executed to get the following output?
cat
Your answer is push(c,s); pop(s); push(a,s); pop(s);push(t,s);pop(s);
What does s mean here?
Your answer is TREE, but explanation says that all options are correct and the best answer is HEAP.
There are two identical correct options
Your answer is circular doubly linked list.
But doubly linked lists can also be concatenated in O(1).
Your answer is selection sort.
Merge sort divides list into TWO SEPARATE SUB-LISTS, sorts them separately and then merges them into one list.
Quick sort reorders list using pivot element, then divides list into TWO SEPARATE SUB-LISTS, and sorts them separately.
So all these answers are correct.
Your answer: 2, 4, 4, 5, 7, 9
Obviously, 2, 3, 4, 5, 6, 7 is correct answer too, it is Non-Decreasing Order: 2<=3<=4<=5<=6<=7.
What is the path compression algorithm?