WGU C949 Sorting Algorithms, Data
Structures, and Algorithm Complexities
Bubble Sort -answer Code compares adjacent elements and swaps them repeatedly
Selection Sort -answer Finds smallest element and swaps with front
Insertion Sort -answer Maintains sorted and unsorted portions
Quick Sort -answer Uses a pivot variable
Merge Sort -answer Splits list exactly in half repeatedly
Heap Sort -answer Builds heap structure
Radix Sort -answer Sorts numbers digit by digit
Bucket Sort -answer Distributes elements into buckets
O(n) -answer Single loop through list
O(n²) -answer Nested loop
O(log n) -answer List halves each iteration
, O(n log n) -answer Divide and merge
O(1) -answer Direct access using index
Binary Search -answer Search checks middle element
Linear Search -answer Search checks every element
Array -answer Uses index like arr[i]
Linked List -answer Uses nodes with next pointer
Doubly Linked List -answer Node has next and previous
Stack -answer Uses push and pop
Queue -answer Uses enqueue and dequeue
Priority Queue -answer Removes highest priority element
Hash Table -answer Uses key-value pairs
Binary Tree -answer Nodes with left and right children
Structures, and Algorithm Complexities
Bubble Sort -answer Code compares adjacent elements and swaps them repeatedly
Selection Sort -answer Finds smallest element and swaps with front
Insertion Sort -answer Maintains sorted and unsorted portions
Quick Sort -answer Uses a pivot variable
Merge Sort -answer Splits list exactly in half repeatedly
Heap Sort -answer Builds heap structure
Radix Sort -answer Sorts numbers digit by digit
Bucket Sort -answer Distributes elements into buckets
O(n) -answer Single loop through list
O(n²) -answer Nested loop
O(log n) -answer List halves each iteration
, O(n log n) -answer Divide and merge
O(1) -answer Direct access using index
Binary Search -answer Search checks middle element
Linear Search -answer Search checks every element
Array -answer Uses index like arr[i]
Linked List -answer Uses nodes with next pointer
Doubly Linked List -answer Node has next and previous
Stack -answer Uses push and pop
Queue -answer Uses enqueue and dequeue
Priority Queue -answer Removes highest priority element
Hash Table -answer Uses key-value pairs
Binary Tree -answer Nodes with left and right children