Algorithms and Data Structures
English
Orta Düzey
This is a Multiple Choice Questions (MCQs) based on Data Structures and Algorithms, where you will be given four options.
Açıklama
35
Soru
30 san
Soru başı
8:56
Ortalama süre
Diskalifiye
Yarışma Puanı
3,3
Topluluk Derecelendirmesi
415
Katılımcı
14 yorum
Holy Duck jüri
Thank you for taking the effort to submit your test for the contest.
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.
Dark Dodo
Good quiz, it was interesting to solve.

Just a small remark, for some questions (Q17, Q23) about the operations with stack, 30 seconds is not enough.
Small Lizard
Questions about stack:

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.
Small Lizard
And one more question about stack:

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?
Small Lizard
With what data structure can a priority queue be implemented?
Your answer is TREE, but explanation says that all options are correct and the best answer is HEAP.
Small Lizard
If a simple graph G, contains n vertices and m edges, the number of edges in the Graph G'(Complement of G) is ...?
There are two identical correct options
Small Lizard
The concatenation of two list can performed in O(1) time. Which of the following variation of linked list can be used?
Your answer is circular doubly linked list.
But doubly linked lists can also be concatenated in O(1).
Small Lizard
Which of the following sort algorithms keep two separate sub-lists?
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.
Small Lizard
Which of the following series is Non-Decreasing Order?
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.
Small Lizard
What is the worst case efficiency for a path compression algorithm?
What is the path compression algorithm?
Small Lizard
In special case, the time complexity of inserting/deleting elements at the end of dynamic array is ...?
What is the special case?
Small Lizard
If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, what is the order of removal?
Your order is push(A), push(B), push(C), push(D), pop(), pop(), pop(), pop().
But this order is also possible: push(A), pop(), push(B), pop(), push(C), pop(), push(D), pop() and answer will be ABCD.
So I think that question is ambiguous.
Small Lizard
What is the reason for the efficiency of a pairing heap?
Your answer is simplicity.
But pairing heap is time efficient too.

Read here: https://en.wikipedia.org/wiki/Pairing_heap
The analysis of pairing heaps' time complexity was initially inspired by that of splay trees.[1] The amortized time per delete-min is O(log n), and the operations find-min, meld, and insert run in O(1) amortized time.[3]
Giant Kitten
Good quiz. Most of the issues are mentioned above. Just to reiterate:
*The stack question with push() and pop(), s is not clearly defined.
*For the priority queue question, the answer says tree yet the best answer is Heap as indicated in the explanation.
*Concatenation of two lists can be achieved with both circular and double linked list with O(1).
*Path compression algorithm question is vague.
*Asking time complexity for insertion and deletion on array, says special case; What special case?
Anyways, good effort. Good luck:)
Yorum bırakmak için teste girin