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

WGU C949 Exam with complete solutions

Rating
-
Sold
-
Pages
2
Grade
A+
Uploaded on
03-06-2023
Written in
2022/2023

binary search - Answer- first 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 - Answer- may require searching all list elements selection sort - Answer- sorting 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 - Answer- f(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) { if ( numbers[j] < numbers[indexSmallest] ) { indexSmallest = j } } // Swap numbers[i] and numbers[indexSmallest] temp = numbers[i] numbers[i] = numbers[indexSmallest] numbers[indexSmallest] = temp } } insertion sort - Answer- sorting 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. insertion sort - Answer- f(numbers, numbersSize) { i = 0 j = 0 temp = 0 // Temporary variable for swap for (i = 1; i < numbersSize; ++i) { j = i // Insert numbers[i] into sorted part // stopping once numbers[i] in correct position while (j > 0 && numbers[j] < numbers[j - 1]) { // Swap numbers[j] and numbers[j - 1] temp = numbers[j] numbers[j] = numbers[j - 1] numbers[j - 1] = temp --j } } } shell sort - Answer- sorting algorithm that treats the input as a collection of interleaved lists, and sorts each list individually with a variant of the insertion sort algorithm. shell sort - Answer- Uses gap values to determine the number of interleaved lists shell sort - Answer- def g(numbers, start_index, gap): for i in range(start_index + gap, len(numbers), gap): j = i while (j - gap >= start_index) and (numbers[j] < numbers[j - gap]): temp = numbers[j] numbers[j] = numbers[j - gap] numbers[j - gap] = temp j = j - gap def f(numbers, gap_values): for gap_value in gap_values:

Show more Read less
Institution
WGU C949
Course
WGU C949








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

Written for

Institution
WGU C949
Course
WGU C949

Document information

Uploaded on
June 3, 2023
Number of pages
2
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

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.
Gordones22 Yala university
View profile
Follow You need to be logged in order to follow users or courses
Sold
492
Member since
3 year
Number of followers
351
Documents
9477
Last sold
1 month ago

4.1

107 reviews

5
63
4
16
3
13
2
4
1
11

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