What
Declare Integer startScan
Declare Integer minindex
Declare Integer minValue
Declare Integer index
For startScan = 0 To arraySize - 2
Set minindex = startScan
Set minValue = array[startScan]
For index = startScan + 1 To arraySize - 1
If array[index] < minValue
Set minValue = array[index]
Set minindex = index
End If
End For
Call swap(array[minIndex], array[startScan])
End For
Learn your wayIncludes step-by-step video
Chapter 9 Solutions
STARTING OUT W/PROGRAM.LOGIC...-TEXT
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Mechanics of Materials (10th Edition)
Management Information Systems: Managing The Digital Firm (16th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
- With number of array elements, a desired element will be searched in the string, and if it is found, its index will be returned, and if not found, the value -1 will be returned. (Use Pointer )arrow_forwardSorted Names Problem:Assume that you already have the bubbleSort () ans swapS() modules. Design the main() program that allows the user to enter 20 names into a String array. Sort the array in ascending (alphabetical) order and display its contents. // The bubbleSort module accepts an array of Strings and array size// and sorts array in ascending orderModule bubbleSort(String Ref array[], integer arraySize) Declare Integer index1, index2 // bubblesort scores For index1 = arraySize – 1 to 0 Step -1 For index2 = 0 to index1 – 1 If array[index2] > array[index2 + 1] Then Call swapS(array[index2], array[index2 + 1) End If End For End ForEnd Module// The swapS module accepts two String elements and swaps their contentsModule swapS(String ref a, String ref b) Declare String temp // Swap a and b Set temp = a Set a = b Set b = tempEnd Modulearrow_forwardtest_var = 'AAMMTTMT';//test_var is testing variable takenarray = test_var.split('');//string is split into the array function SWAP(TAM, i, j)//function to swap{temp = TAM[i];TAM[i] = TAM[j];TAM[j] = temp;}function sort_AMT(TAMUK)//function to sort the array{for(i = 0; i<TAMUK.length;i++){for(j = 0; j<TAMUK.length-1;j++){if(TAMUK[i]<TAMUK[j])SWAP(TAMUK,i,j);}}console.log(TAMUK);} sort_AMT(array);//function call How to write an HTML code for this javascript result/output? where the result will be displayed in HTML page.arrow_forward
- test_var = 'AAMMTTMT';//test_var is testing variable takenarray = test_var.split('');//string is split into the array function SWAP(TAM, i, j)//function to swap{temp = TAM[i];TAM[i] = TAM[j];TAM[j] = temp;}function sort_AMT(TAMUK)//function to sort the array{for(i = 0; i<TAMUK.length;i++){for(j = 0; j<TAMUK.length-1;j++){if(TAMUK[i]<TAMUK[j])SWAP(TAMUK,i,j);}}console.log(TAMUK);} sort_AMT(array);//function call Can I have this program output and code in HTML page?arrow_forwardJAVA CODE PLEASE Functions with 1D Arrays Practice I by CodeChum Admin Instruction: Write a program that has a function that accepts a character array and counts the number of vowel in character array. Output Number·of·vowels:·5arrow_forwardAn array is a collection of similar data elements stored at contiguous memory locations. It is the simplest data structure where each data element can be accessed directly by only using its index number. The following is an array of unsorted numbers called NumArr. NumArr: 24 56 78 79 34 75 2 23arrow_forward
- c++ language using addition, not get_sum function with this pseudocode: Function Main Declare Integer Array ages [ ] Declare integer total assign numbers = [ ] assign total = sum(ages) output "Sum: " & total end fucntion sum(Integer Array array) declare integer total declare integer index assign total = 0 for index = 0 to size(array) -1 assign total = total + array[ ] end return integer totalarrow_forwardSearch Benchmarks Design an application in pseudocode that has an array of at least 20 integers. It should call a module that uses the sequential search algorithm to locate one of the values. The module should keep a count of the number of comparisons it makes until it finds the value. Then the program should call another module that uses the binary search algorithm to locate the same value. It should also keep a count of the number of comparisons it makes. Display these values on the screen.arrow_forwardC++ LANGUAGE Search Metrics In this exercise you will explore the performance difference between sequential search and binary search. To do so write a program that performs the following tasks: Prompt the user for a file containing 100,000 unsorted integers Read those integers into an array Prompt the user for a search item Search for that item (using sequential search) and report the number of comparisons required. Sort the array. Note that this might take a few minutes. Search for that item again (using binary search) and report the number of comparisons required. You will need to modify both of the search functions to report the number of comparisons that were made during the search. Use your program and the file of 100,000 integers provided here to answer the six questions in the quiz. May i know whats the program please?arrow_forward
- MIPS assembly language program Linear Search: Write a MIPS assembly language program that can search for a number that entered by user in an array with 20 integer numbers and prints the index of the number in the array if it is found.arrow_forwardArray TypesObjective: Based on the given values and initializations, give what is being required of each statement.1. Given A[10], α=2000, esize=4 bytes:a) Find the number of elements.b) Find the address of the 6th element.c) Find the index no. of the 8th element.2. Given E[3][4], α=2020, esize=4 bytes:a) Find the total no. of elements.b) Find the address of the last element.c) Find the address of the 10th element.arrow_forwardTRUE or FALSE - A pointer can be used to access elements of an array. Select one: a.TRUE b.FALSEarrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning