100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Quiz 5B Questions DSA Questions with Solutions $11.49   Add to cart

Exam (elaborations)

Quiz 5B Questions DSA Questions with Solutions

 6 views  0 purchase
  • Course
  • DSA
  • Institution
  • DSA

Quiz 5B Questions DSA

Preview 1 out of 4  pages

  • August 29, 2024
  • 4
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • DSA
  • DSA
avatar-seller
Dreamer252
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

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Dreamer252. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $11.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

84866 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$11.49
  • (0)
  Add to cart