Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You will write pseudocode to achieve the requirements described below. Assume th

ID: 3749629 • Letter: Y

Question

You will write pseudocode to achieve the requirements described below.

Assume there is an integer array called numbers of size n (where n > 1)

The first m slots of the array (where m < n) are populated with integers.

The integers are sorted in an increasing order.

Assume the user entered an integer that is stored in a variable called num.

Write pseudocode that will insert the value of num into the array numbers while keeping the order.

example:

Use ONLY the following vocabulary:

replace the bold parts with your variables and expressions.

define a datatype called variable_name

example:

copy from expression to variable_name

note: the data type of expression must match that of variable_name

example:

while (boolean_expression)

note1: inside a while loop, put 4 white spaces for indents

note2: you CANNOT use a break statement.

example:

if (boolean_expression)

note1: inside an if statement, put 4 white spaces for indents

node2: you can use "else".

example:

n-5 m 3 num 5 numbers[3 68 n-5 num 5 numbers3 568

Explanation / Answer

Please find the required answer for your question.Let me know if you have any concerns.

//Defining the array numumber of size n and m numbers inserted till now
define an int called num
define an int called n
define an int called m
define an int array called number
//define a function sort method
sort(int array called number,int called num,int called n){
define an int called i
copy from 0 to i
while(i<n){//we will get a new num and check all the elements in the array  
define an int called cur
copy from num to cur
define an int called j
copy from i to j

while(j> 0 and num[j-1] > cur){ // finding correct place of num in the array num
define an int called key //swapping numbers until we get correct place of num
copy from num[j-1] to key
copy from num[j] to num[j-1]
copy from key to num[j]
copy from j-1 to j
}
copy from i+1 to i
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote