Selection-Sort( A[1..n] )
1 2 3 4 5 6 7 8 9
10
// INPUT: A[1..n],...
Selection-Sort( A[1..n] )
1 2 3 4 5 6 7 8 9
10
// INPUT: A[1..n], an array of any n numbers in unknown order
integer i, j, m
fori=1ton−1
do
swap A[i] ↔ A[m]
// OUTPUT: A[1..n], its numbers now sorted in non-decreasing
order
m=i
for j = i to n
do if A[j] < A[m] then m = j
Give a proof that this algorithm sorts its input as
claimed.
Giving an array of integers A[1:8] ={5, 1, 3, 2, 7, 6, 8,
4}.
Build a...
Giving an array of integers A[1:8] ={5, 1, 3, 2, 7, 6, 8,
4}.
Build a MAX-HEAP on A. Show the steps using binary tree
representation or array view.
Use heap sort: show the array after the first, the second, and
the third of heap sort
Given this array: int sequence[10] = { 3, 4, 5, 6, 7, 8, 9, 10,
1,...
Given this array: int sequence[10] = { 3, 4, 5, 6, 7, 8, 9, 10,
1, 2 }; Write a C++ program to ask the user to enter a number, if
the number can be found in the array, your program should display
"Found". Otherwise, your program should display "Not found". For
example, if the user enters 7, your program should display "Found".
If the user enters 11, your program should display "Not found".
Let p = (8, 10, 3, 11, 4, 0, 5, 1, 6, 2, 7, 9) and...
Let p = (8, 10, 3, 11, 4, 0, 5, 1, 6, 2, 7, 9) and let q = (2,
4, 9, 5, 10, 6, 11, 7, 0, 8, 1, 3) be tone rows. Verify that p =
Tk(R(I(q))) for some k, and find this value of k.
Consider the following array: int[] a = { 3, 5, 2, 2, 4, 7, 0,
8,...
Consider the following array: int[] a = { 3, 5, 2, 2, 4, 7, 0,
8, 9, 4 }; What are the contents of the array a after the following
loops complete? (show how you arrive at the answer)
a) for (int i = 1; i < 10; i++) { a[i] = a[i - 1];
b) for (int i = 9; i > 0; i--) { a[i] = a[i - 1]; }
This program is in C++, And please consider " sort pass
#" for the output:
Write...
This program is in C++, And please consider " sort pass
#" for the output:
Write a program that uses two identical arrays of eight
integers. It should display the contents
of the first array, then call a function to sort it using an
ascending order bubble sort, modified
to print out the array contents after each pass of the sort. Next
the program should display the
contents of the second array, then call a function to sort it using...
Stem
Leaf
2
6
3
0, 7
4
0, 2, 6
5
1, 5, 7, 9,...
Stem
Leaf
2
6
3
0, 7
4
0, 2, 6
5
1, 5, 7, 9, 9
6
0, 2, 5, 8
1) standard deviation:
2)Find Five-number summary of the data set
3). Draw a box plot that represents the data set