Answer:
Explanation:
The following code is written in Java. It creates a method for each of the sorting algorithms and one method to reset the array and print the original, so that all algorithms can be tested with the same array.The entire program code is below.
import java.util.Scanner;
class Brainly {
static int[] arr;
public static void main(String[] args) {
// Print Unsorted Array and Call Selection Sort and print
resetArray();
SelectionSorter(arr);
System.out.print("\nSelection Sort Array: ");
for (int x : arr) {
System.out.print(x + ", ");
}
//Reset Array and call Bubble Sort and print
System.out.println('\n');
resetArray();
BubbleSorter(arr);
System.out.print("\nBubble Sort Array: ");
for (int x : arr) {
System.out.print(x + ", ");
}
//Reset Array and call Insert Sort and print
System.out.println('\n');
resetArray();
InsertSorter(arr);
System.out.print("\nInsert Sort Array: ");
for (int x : arr) {
System.out.print(x + ", ");
}
}
public static void resetArray() {
arr = new int[]{10, 14, 28, 11, 7, 16, 30, 50, 25, 18};
System.out.print("Unsorted Array: ");
for (int x : arr) {
System.out.print(x + ", ");
}
}
public static void SelectionSorter(int[] arr) {
for (int i = 0; i < arr.length - 1; i++) {
int index = i;
for (int j = i + 1; j < arr.length; j++) {
if (arr[j] < arr[index]) {
index = j;//searching for lowest index
}
}
int smallerNumber = arr[index];
arr[index] = arr[i];
arr[i] = smallerNumber;
}
}
static void BubbleSorter(int[] arr) {
int n = arr.length;
int temp = 0;
for (int i = 0; i < n; i++) {
for (int j = 1; j < (n - i); j++) {
if (arr[j - 1] > arr[j]) {
//swap elements
temp = arr[j - 1];
arr[j - 1] = arr[j];
arr[j] = temp;
}
}
}
}
public static void InsertSorter(int arr[]) {
int n = arr.length;
for (int j = 1; j < n; j++) {
int key = arr[j];
int i = j - 1;
while ((i > -1) && (arr[i] > key)) {
arr[i + 1] = arr[i];
i--;
}
arr[i + 1] = key;
}
}
}
You are a web designer, and a client wants you to create a website for their new business. Discuss what you would talk about with the client to ensure they were getting the website they wanted. What questions would you ask the client? What information would you need from the client?
Answer:
1. for what purpose?
2. the pattern design of web
3. what the client wants to add in the web
4. his contact number and email
5. the logo of the business
6. talk about pricing
Explanation: