Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Big Java Late Objects
Quiz 14: Sorting and Searching
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 41
Multiple Choice
In the worst case, a linear search locates a value in an array of length n in ____ steps.
Question 42
Multiple Choice
Which of the sorts in the textbook are based on the strategy of divide and conquer? I quicksort II mergesort III insertion sort
Question 43
Multiple Choice
In the textbook, we found that the number of element visits for merge sort totaled N + 5nlog
2
n. Let's consider sorting 1024 elements. How many visits are needed?
Question 44
Multiple Choice
If an element is present in an array of length n, how many element visits, in the worst case, are necessary to find it using a linear search?
Question 45
Multiple Choice
When does quicksort's worst-case run-time behavior occur? I when the data is randomly initialized in the array II when the data is in ascending order III when the data is in descending order
Question 46
Multiple Choice
Which sort algorithm starts by partitioning the array and selecting a pivot element?
Question 47
Multiple Choice
Which sort algorithm is used in the sort method in the Java Arrays class when the array length is less than 7?
Question 48
Multiple Choice
Selection sort has O(n
2
) complexity. If a computer can sort 1,000 elements in 4 seconds, approximately how many seconds will it take the computer to sort 1,000 times that many, or 1,000,000 elements?
Question 49
Multiple Choice
Assume we are using quicksort to sort an array in ascending order. What can we conclude about the indexes of two pivot elements placed in consecutive recursive calls?
Question 50
Multiple Choice
Merge sort is a(n) ____ algorithm.
Question 51
Multiple Choice
Merge sort has a O(n log
2
(n) ) complexity. If a computer can sort 1,024 elements in an amount of time x, approximately how much longer will it take the computer to sort 1,024 times that many, or 1,048,576 elements?
Question 52
Multiple Choice
Which of the sorts in the textbook can be characterized by the fact that the best case will have a running time of θ(n) if the data is already sorted? I quicksort II selection sort III insertion sort
Question 53
Multiple Choice
In the worst case, quicksort is a(n) ____ algorithm.
Question 54
Multiple Choice
In the textbook, we found that the number of element visits for merge sort totaled N + 5n log
2
n. Which of the following is the appropriate big-Oh notation for merge sort?
Question 55
Multiple Choice
Suppose you have a phone number and need to find the address that it corresponds to. If there are 2,000,000 entries, how many do you expect to search in a printed phone directory before finding the address you are looking for?