100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Quiz 5B Questions DSA Questions with Solutions

Rating
-
Sold
-
Pages
4
Grade
A+
Uploaded on
29-08-2024
Written in
2024/2025

Quiz 5B Questions DSA

Institution
DSA
Course
DSA








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
DSA
Course
DSA

Document information

Uploaded on
August 29, 2024
Number of pages
4
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

Quiz 5B Questions DSA

In Binary Search, the best case occurs when: - answer The item is located in the middle
of the collection.

For linear or sequential search, the average case time performance is: - answer O(n)

In Binary Search, the worst case occurs when: (select all that apply) - answer The item
is not in the collection.
The item is located at the very beginning of the collection.
The item is located at the end of the collection.

Which of the following statements about QuickSort and Mergesort are true?
A. Mergesort is not an example of the divide and conquer algorithm design strategy
because it only does Θ(1) work to divide the problem into two subproblems.
B. Quicksort has a better space-complexity than mergesort because partition() has
space-complexity of Θ(1) while merge() has space-complexity of Θ(n).
C. Both sorts can be made into hybrid sorts by using a non-recursive sort like insertion
sort to process subproblems smaller than a certain size. - answerB and C are true

Which of the following is NOT true about using the compareTo() method in Java to sort
things? - answerYou could rewrite the body of your compareTo() method in order to sort
a list in descending order instead of ascending order.

Assume values is an array of integers that is currently filled to capacity, with the
following values:
9 4 12 2 6 8 18
Which of the following lists of numbers would accurately show the array after the fourth
pass of Insertion sort? - answer2, 4, 6, 9, 12, 8, 18

A vector contains the numbers <7, 2, 9, 5, 4, 1> and Insertion Sort is run on this list.
Which of the following list orderings will never occur during any step of the sorting
process? We are only concerned with the state of the list at the beginning of each
iteration of the outer loop (after each element is fully "inserted"). - answer2, 7, 9, 4, 5, 1

Assume values is an array of integers that is currently filled to capacity, with the
following values:
9 4 12 2 6 8 18
Which of the following lists of numbers would accurately show the array after the fourth
pass of Selection sort? - answer2, 4, 6, 8, 12, 9, 18

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Dreamer252 NBursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
477
Member since
2 year
Number of followers
293
Documents
21305
Last sold
1 week ago

4.0

115 reviews

5
60
4
22
3
18
2
2
1
13

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions