Data Structures and Algorithms Quiz
English
Expert
A quiz about data structures and algorithms. This quiz would need an advance level of knowledge on programming, algorithms, data structures and computer systems.
Description
50
Questions
30 sec
Per question
9:40
Average time
Disqualified
Contest Score
4.4
Community Rating
56
Participants
33 comments
Giant Elk judge
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. Questions, answers, explanations were copied from an existing test. E.g.: “#q1” <= https://books.google.co.ve/books?id=NqBDDAAAQBAJ&pg=PA1&lpg=PA1&dq=The+OS+of+a+computer+may+periodically+collect+all+the+free+memory+space+to+form+a+contiguous+block+of+free+space.+This+is+know+as&source=bl&ots=vKu6ioZ-AS&sig=ACfU3U1_LgM9GG8sWf16j_UUsRtq50Kxog&hl=en&sa=X&ved=2ahUKEwjkoazk95PqAhV-QjABHe93B9cQ6AEwBXoECAoQAQ#v=onepage&q=The%20OS%20of%20a%20computer%20may%20periodically%20collect%20all%20the%20free%20memory%20space%20to%20form%20a%20contiguous%20block%20of%20free%20space.%20This%20is%20know%20as&f=false, “#q3” <= https://books.google.co.ve/books?id=NqBDDAAAQBAJ&pg=PA1&lpg=PA1&dq=The+OS+of+a+computer+may+periodically+collect+all+the+free+memory+space+to+form+a+contiguous+block+of+free+space.+This+is+know+as&source=bl&ots=vKu6ioZ-AS&sig=ACfU3U1_LgM9GG8sWf16j_UUsRtq50Kxog&hl=en&sa=X&ved=2ahUKEwjkoazk95PqAhV-QjABHe93B9cQ6AEwBXoECAoQAQ#v=onepage&q=The%20OS%20of%20a%20computer%20may%20periodically%20collect%20all%20the%20free%20memory%20space%20to%20form%20a%20contiguous%20block%20of%20free%20space.%20This%20is%20know%20as&f=false, “#q6” <= https://books.google.co.ve/books?id=NqBDDAAAQBAJ&pg=PA1&lpg=PA1&dq=The+OS+of+a+computer+may+periodically+collect+all+the+free+memory+space+to+form+a+contiguous+block+of+free+space.+This+is+know+as&source=bl&ots=vKu6ioZ-AS&sig=ACfU3U1_LgM9GG8sWf16j_UUsRtq50Kxog&hl=en&sa=X&ved=2ahUKEwjkoazk95PqAhV-QjABHe93B9cQ6AEwBXoECAoQAQ#v=onepage&q=The%20OS%20of%20a%20computer%20may%20periodically%20collect%20all%20the%20free%20memory%20space%20to%20form%20a%20contiguous%20block%20of%20free%20space.%20This%20is%20know%20as&f=false, etc.
Giant Kitten author
Thank you for letting me be a part of this contest.
I would like to say I didn't copy from the book(site) mention when preparing the quiz. I prepared my quiz using notes and excercises from the course I attended. Sure I can see the resemblance with my questions but anything would resemble something on the Internet.

Thank you for the comment and I appreciate all the work you are doing.
Stout Shrimp
> Adjacency matrix can contain the information of parallel edges, edges, nodes and directed edges.
Let's say you have an NxN matrix M where N is the amount of nodes:
• M[i, j] = number of directed edges going from node i to node j
• M[i, i] could has an object representing the information of node i
• M[i, j] = M[j, i] for undirected graphs

> Bubble sort is a stable algorithm:
https://en.m.wikipedia.org/wiki/Bubble_sort

Insertion sort algorithm is stable:
https://en.m.wikipedia.org/wiki/Insertion_sort

Heap sort is not stable:
https://en.m.wikipedia.org/wiki/Heapsort
Giant Kitten author
Thanks, yet it was meant as which one is more stable than the others.🤘👍
Stout Shrimp
Giant Kitten There is not "a more stable" thing. It's stable or not. Also the answer is wrong as well, because the answer is heapsort and heapsort is not stable at all.
Giant Kitten author
Stout Shrimp Yeah, thanks. You are right, the question was meant to ask which is not stable and then answer heap sort. My bad, sorry. I was racing with time for submission and got them mixed up.
Giant Kitten author
For a finite undirected graph allowing parallel edges, loops, and weightsIf we allow loops (but no parallel edges or weights), the definition does not change, but it may now be possible to have 1s on the diagonals at the entries corresponding to loops.If we allow parallel edges, then the  entry is taken to be the number of edges between  and .If we allow weights, we could use the weighted adjacency matrix instead. It would change its properties as of undirected graph
https://graph.subwiki.org/wiki/Adjacency_matrix
And yeah, its ambigous and totally not what I intended.
Stout Shrimp
Giant Kitten The diagonal could not be filled with 1's. Also, as I said before, an adjacency matrix is just a representation, you can have whatever data at a row, column position. So you could have an object, data structure, or whatever you want in there, such as weights, loops or other things.
@bela
nice
Small Lizard
The small element of an array's index is called its...
The smallest element of an array's index is called its lower bound or bottom of the areay, mostly 0 since its index starts at 0.
The small element? Maybe, you meant the smalLEST INDEX?
Giant Kitten author
Yes, it was meant in that sense.
Small Lizard
In worst case, Quick sort has the order of...
Two options "O(n²/2)" and "O(n²/4)" are equal, so this question has two correct answers.

This question appears twice in quiz.
The second appearence:
The worst case of quick sort has order...
It is correct, the only correct option in it is "O(n²)".

And once again about complexity:
Merging 4 sorted files containing 50, 10, 40, 25 records will take time complexity of...
All options "O(200)", "O(100)", "O(250)" and "O(125)" are equal too.

Read here: https://en.wikipedia.org/wiki/Big_O_notation
Giant Kitten author
Thanks for pointing that out.
Worst case performance of Quick Sort has the order O(n²).
Merging files question was not meant as linear Big O representation, it was refering as it already sorted, it would take a total time complexity of all files.
Small Lizard
A sorting technique which passes through the list exchanging the first element with any element less than it then repeats this with the new first element is known as...
Obviously, the correct answer is selection or insertion sort, but your answer is quick sort.
Giant Kitten author
Thank you for this comment. You are right. The given answer was wrong. The correct answer should have been Selection Sort. Selection sort can be implemented as a stable sort. If, rather than swapping in step 2, the minimum value is inserted into the first position (that is, all intervening items moved down), the algorithm is stable.
Small Lizard
The minimum number of multiplications and additions required to evaluate the polynomial
P = 4x³ + 6x² + 9x + 34 is
Here, answer is correct, but explanation is wrong. What best scenario? We need to calculate P = 4x³ + 6x² + 9x + 34 for any x given.
Correct explanation would be:
Let T be temporary variable.
T=4*x
T=T+6
T=T*x
T=T+9
T=T*x
T=T+34
Now T is the result of calculating the polynomial, and we used 3 additions and 3 multiplications.
Giant Kitten author
Thank you for this comment. Your explanation is spot on. I was trying to explain it without expressions and failed as you pointed out.
Small Lizard
If a node having two children is deleted from a binary tree, it is replaced by its...
Your answer is inorder successor.
But why not to replace it with inorder predecessor? All tree structure will remain correct.
Giant Kitten author
Thanks for the comment. I choose Inorder successor as it's the conventional way to do it. But I guess you pointed another way to achieve it. Sorry for the ambiguity.
Small Lizard
To convert a binary tree into its mirror image, traverse it in...
Your answer is postorder.
But postorder is just list of nodes. How to convert in into tree mirror image (which is tree)?
Giant Kitten author
Sorry for the confusion. I meant to create a mirror tree. Mirror Tree of a binary tree is where left and right child of every node of given binary tree is interexchanged. And the answer should have been Pre order traversal. Thank you for the comment.
Small Lizard
A technique that can be used for a direct search is...
What is direct search?
Giant Kitten author
Appreciate the comment. Sorry for the misleading approach. It was asking as to what uses direct access approach. Search algorithms that use hashing work by direct access based on key value. Hashing involves a hash function: a function that transforms the search key into an array index, and a collision-resolution process that deals with the cases where multiple keys are mapped to the same index.
Take the quiz to leave a comment