Question: 1 . Write a program in C or C++ to sort a set of integers. Use quicksort algorithm. Input (from standard input: keyboard): 1. n

1. Write a program in C or C++ to sort a set of integers. Use quicksort algorithm.

Input (from standard input: keyboard):

1. n the number of integers to be sorted

2. n integers

Output: The n numbers sorted in increasing order.

Submit:

1. Your source code (the C/C++ program)

2. Screenshots of two sets of input and output (run your program twice). There must be at least 10 numbers in each set of input/output.

2. Write a program in C or C++ for binary search. First you need to sort a set of numbers (using the quicksort algorithm above). Then apply binary search.

Input (from standard input: keyboard):

1. n the number of input integers

2. n integers

3. Two integers these two integers are the keys. You need to search these two integers in the set of n numbers above.

Output: Output whether the two keys are in the set of n numbers.

Submit:

3. Your source code (the C/C++ program)

4. Screenshots of the input and output. n must be at least 10.

3. Write a program in C or C++ to implement a hash table with m = 13 and hash function: h(k) = k mod m

Initially store the following numbers in the hash table: 20, 75, 315, 101, 7, 545, 213, 67. Then perform the following sequence of insert and delete operations:

Delete: 213

Insert: 135

Delete: 20, 75, 7

Insert: 71

Delete: 135

Now search the following two numbers in the hash table: 135, 315. Then display the final content of the hash table.

Submit:

5. Your source code (the C/C++ program)

6. Screenshots of the output for: a) the search operations b) the final content of the hash table.

4. What are the differences between stacks and queues?

5. Write pseudocode for the enqueue and dequeue operations in a queue.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!