Data Structures and Algorithms Quiz
English
Especialista
A quiz about data structures and algorithms. This quiz would need an advance level of knowledge on programming, algorithms, data structures and computer systems.
Descrição
Computer Science, English, Programming, Data structures, Algorithms, Complexity, Search algorithms, Sorting algorithms, Trees, Arrays, Queue, Graph
Tags
50
Perguntas
30 seg
Por pergunta
11:19
Tempo médio
Desqualificado
Pontos no Concurso
4,4
Pontos da Comunidade
157
Participantes
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
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.
Obviously, the correct answer is selection or insertion sort, but your answer is quick sort.
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.
Your answer is inorder successor.
But why not to replace it with inorder predecessor? All tree structure will remain correct.
Your answer is postorder.
But postorder is just list of nodes. How to convert in into tree mirror image (which is tree)?
What is direct search?
Your answer is arrays.
But how pointers can store the non-homogenous data elements?
Your answer is bubble sort.
But insertion sort is correct too.
Let's read https://en.wikipedia.org/wiki/Insertion_sort:
Adaptive, i.e., efficient for data sets that are already substantially sorted: the time complexity is O(kn) when each element in the input is no more than k places away from its sorted position
Your answer is full binary tree.
But correct is complete binary tree.
Proof: https://en.wikipedia.org/wiki/Binary_tree#Types_of_binary_trees
A full binary tree is a tree in which every node has either 0 or 2 children.
In a complete binary tree every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible.
There are two correct options: "2^d" and "(2^d-1) + 1", they are equal. Maybe, you missed parentheses?
at depth d is 2^d.
Some evidence:
https://www.gkseries.com/computer-engineering/data-structure/discussion-39
https://compscibits.com/Data-Structures-and-Algorithms/Trees/discussion/6428
https://mympsc.com/Share.aspx?Articleid=7996c90d-087b-483e-91fd-3ba69632fa72
https://upscgk.com/upsc-gk/d102e22e-6d6d-4c8e-84f3-fbd92530245f/the-searching-technique-that-takes-o-1-time-to-find-a-data-is
https://mympsc.com/Share.aspx?ArticleID=F212ED85-4998-4F65-971A-171855551F6A