Case Study 1 Problem: Merge Sort Merge Sort follows the rule of Divide and Conquer to sort a given set of numbers/elements, recursively, hence consuming less time. Merge sort runs in O(n*log n) time in all the cases. Two functions are involved in this algorithm. The merge() function is used for the merging two halves and the mergesort() function recursively calls itself to divide the array until the size becomes one. Use the array below to perform a Merge Sort. Show all necessary workings. (75, 22, 65, 97, 35, 56, 18, 89} Case Study 2

icon
Related questions
Question
Case Study 1
Problem: Merge Sort
Merge Sort follows the rule of Divide and Conquer to sort a given set of
numbers/elements, recursively, hence consuming less time.
Merge sort runs in O(n*log n) time in all the cases. Two functions are involved in this
algorithm. The merge() function is used for the merging two halves and the mergesort()
function recursively calls itself to divide the array until the size becomes one.
Use the array below to perform a Merge Sort. Show all necessary workings.
{75, 22, 65, 97, 35, 56, 18, 89}
Case Study 2
Problem: Hashing
Hashing is a technique to convert a range of key values into a range of indexes of an
array. Load Factor is a measure of how full the hash table is allowed to get before its
capacity is automatically increased which may cause a collision. When collision occurs,
there are two simple solutions: Chaining and Linear Probe.
In what order could the elements have been added using the output below and given
the following hash table implemented using linear probing. Note the following:
ABCDE
1. The hash function used is the identity function, h(x) = x.
2. Assume that the hash table has never been resized, and no elements have been
deleted yet.
3. There are several correct answers
4. Show all workings
2
с
0
9
1
18
3
12
А 9, 14, 4, 18, 12, 3, 21
12, 3, 14, 18, 4, 9, 21
12, 14, 3, 9, 4, 18, 21
9, 12, 14, 3, 4, 21, 18
12, 9, 18, 3, 14, 21, 4
4
3
5
14
6
4
7 8
21
2
Transcribed Image Text:Case Study 1 Problem: Merge Sort Merge Sort follows the rule of Divide and Conquer to sort a given set of numbers/elements, recursively, hence consuming less time. Merge sort runs in O(n*log n) time in all the cases. Two functions are involved in this algorithm. The merge() function is used for the merging two halves and the mergesort() function recursively calls itself to divide the array until the size becomes one. Use the array below to perform a Merge Sort. Show all necessary workings. {75, 22, 65, 97, 35, 56, 18, 89} Case Study 2 Problem: Hashing Hashing is a technique to convert a range of key values into a range of indexes of an array. Load Factor is a measure of how full the hash table is allowed to get before its capacity is automatically increased which may cause a collision. When collision occurs, there are two simple solutions: Chaining and Linear Probe. In what order could the elements have been added using the output below and given the following hash table implemented using linear probing. Note the following: ABCDE 1. The hash function used is the identity function, h(x) = x. 2. Assume that the hash table has never been resized, and no elements have been deleted yet. 3. There are several correct answers 4. Show all workings 2 с 0 9 1 18 3 12 А 9, 14, 4, 18, 12, 3, 21 12, 3, 14, 18, 4, 9, 21 12, 14, 3, 9, 4, 18, 21 9, 12, 14, 3, 4, 21, 18 12, 9, 18, 3, 14, 21, 4 4 3 5 14 6 4 7 8 21 2
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer