• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 4 pages
Exam (elaborations)

Data Structures – Sorting Exam Questions And Answers

Document preview thumbnail
Preview 1 out of 4 pages

DATA STRUCTURES – SORTING EXAM QUESTIONS AND ANSWERS

Content preview

DATA STRUCTURES – SORTING
EXAM QUESTIONS AND ANSWERS



Internal and external sorting - Correct Answers -What are the two types of sorting?

the number of comparisons of keys AND the number of times entries must be moved
inside a list - Correct Answers -What are the two major factors used to evaluate the
performance of a sorting algorithm?

internal sorting - Correct Answers -records to be sorted are kept in RAM

external sorting - Correct Answers -records are kept in external files on disks, tapes, or
other secondary storage devices

The performance of a sorting algorithm is closely related to the ... - Correct Answers -
underlying data structure of a list (algorithm should be aware of the implementation of
the list - preferable to implement the sorting algorithm as a method of the list class
[sortable list]}

when the list is already in sorted order (only n - 1 comparison of keys) - Correct
Answers -The best case for contiguous insertion sort occurs...

when the list is in reverse order - Correct Answers -The worst case for contiguous
insertion sort occurs...

Selection sort is more suitable for long contiguous list than insertion sort - Correct
Answers -In what situation may you select selection sort over insertion sort?

It is easy to implement. - Correct Answers -What is the advantage of bubble sort?

numbers that are multiples of each other - Correct Answers -When Shell sort is used,
what types of increments should you avoid?
quicksort - Correct Answers -best: O(n lg n)
avg: O(n lg n)
worst: O(n^2)
idea: partition the list using some chosen key called the pivot (those less than pivot in
one sublist, those greater in another); sort separately and merge at the end

radix sort - Correct Answers -best: O(nk)

Document information

Uploaded on
July 28, 2025
Number of pages
4
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$11.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
millyphilip
3.7
(562)
Sold
3010
Followers
1964
Items
47650
Last sold
1 hour ago



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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions