Overview One of the most important studied problems is sorting. In this assignme
ID: 3592817 • Letter: O
Question
Overview One of the most important studied problems is sorting. In this assignment, you will write multiple implementations of sorting algorithms. Part 1: Create a skeleton GUI as depicted in the requirement below. This GUI will not have any functionality behind the Java components: Part 2: Create a class that generates 4 types of lists of 0-30000 numbers; InOrder ReverseOrder, AlmostOrder, Random. Part 3: Implement various sorting algorithms as listed in the requirement; Insertion, Selection, Quick, Merge, Heap, Radix sorts. We will review these algorithms in class Part 4: Put functionality behind the components created in part 1 to create a working application; and output the experimental results. No emails: All details pertaining to the requirements will be discussed in class. Be prepared to demo your work; if your name is selected randomly Part 1, 2: Due Oct 1 at 11:30pm Part 3, 4: Due Oct 8 at 11:30pm Example run: Sorting Techniques Winning Algorithm Insertion Sort Insertion Sort List Properties Inorder Selection Sort AlmostOrder Random 15286 Quick Sort Create The List Experimental Results MergeSort N: 15286 DataType: Random Sort: Insertion Heap Sort Comparisons: 116823255 Movements: 45855 Total time: 230 Radix SortExplanation / Answer
#include <iostream>
#include <vector>
using namespace std;
const int SIZE = 30;
int main()
{
vector<int> v;
for (int i = 0; i < SIZE; ++i) v.push_back(i);
int pick[SIZE];
for (int i = 0; i < SIZE; ++i)
{
int r = v[rand() % v.size()];
v.erase(find(v.begin(), v.end(), r));
pick[i] = r;
cout << pick[i] << endl;
}
return 0;
}
Output:
3
16
10
0
2
14
15
6
17
4
7
11
8
13
19
5
1
9
12
18
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.