All Tracks/quiz searching and sorting algorithms/
Đang tải...
Hướng dẫn thử thách
1 / 1

Searching and Sorting Algorithms Quiz

To pass the quiz, you must correctly answer at least 9 of the 10 questions below. # --quizzes-- ## --quiz-- ### --question-- #### --text-- Which search algorithm iterates through a list of items, checking each item from the beginning until the target item is found? #### --distractors-- Merge search --- Bubble search --- Binary search #### --answer-- Linear search ### --question-- #### --text-- Which technique is used to break down a problem into smaller sub-problems? #### --distractors-- Break-down-and-solve --- Divide-and-solve --- Break-down-and-conquer #### --answer-- Divide-and-conquer ### --question-- #### --text-- What is the space complexity of the linear search algorithm? #### --distractors-- `O(n)` --- `O(log n)` --- `O(n²)` #### --answer-- `O(1)` ### --question-- #### --text-- Which is more suitable for a larger list of items between binary search and linear search? #### --distractors-- Both --- Linear search --- None #### --answer-- Binary search ### --question-- #### --text-- What is the space complexity of binary search? #### --distractors-- `O(log n)` --- `O(n)` --- `O(n log n)` #### --answer-- `O(1)` ### --question-- #### --text-- What does the binary search algorithm return when it finds the target item? #### --distractors-- The value of the target item. --- The size of the list searched. --- A boolean value of the target. #### --answer-- The index of the target item. ### --question-- #### --text-- What does the linear search algorithm return if it doesn't find the target item? #### --distractors-- `0` --- `Null` --- `Undefined` #### --answer-- `-1` ### --question-- #### --text-- How does the merge sort algorithm work? #### --distractors-- It searches for an element by checking each item one by one. --- It builds a sorted list by repeatedly finding the smallest element. --- It swaps adjacent elements until the list is sorted. #### --answer-- It recursively splits the list into smaller items, then merges them in sorted order. ### --question-- #### --text-- What is the condition for a binary search to work? #### --distractors-- The list must contain only unique values. --- The list must have an even number of elements. --- The list must contain no negative numbers. #### --answer-- The list must be sorted. ### --question-- #### --text-- Which computer science approach is used to implement the merge sort algorithm? #### --distractors-- Dynamic programming --- Greedy algorithm --- Tracing #### --answer-- Divide-and-conquer
Vượt qua bài kiểm tra hiện tại để mở khóa bài tiếp theo.
main.js
UTF-8 • Tab Size: 2Kiểm tra bài:⌘↵
Test Output
Thử thách này không có bài test tự động. Hãy quan sát kết quả trực tiếp ở khung Preview.