binary search - answerfirst checks the middle element of the list. If the search key is
found, the algorithm returns the matching location. If the search key is not found, the
algorithm repeats the search on the remaining left sublist (if the search key was less
than the middle element) or the remaining right sublist (if the search key was greater
than the middle element)
linear search - answermay require searching all list elements
selection sort - answersorting algorithm that treats the input as two parts, a sorted part
and an unsorted part, and repeatedly selects the proper next value to move from the
unsorted part to the end of the sorted part.
selection sort - answerf(numbers, numbersSize) {
i=0
j=0
indexSmallest = 0
temp = 0
for (i = 0; i < numbersSize - 1; ++i) {
indexSmallest = i
for (j = i + 1; j < numbersSize; ++j) {
insertion sort - answersorting algorithm that treats the input as two parts, a sorted part
and an unsorted part, and repeatedly inserts the next value from the unsorted part into
the correct location in the sorted part.
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
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
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 $13.99. You're not tied to anything after your purchase.