1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sdas [7]
3 years ago
12

Give a recursive version of the algorithm Insertion-Sort (refer to page 18 in the textbook) that works as follows: To sort A[1..

n], we sort A[1..n − 1] recursively and then insert A[n] in its appropriate position. Write a pseudocode for this recursive version of InsertionSort and analyze its running time by giving a recurrence relation and solving it
Computers and Technology
1 answer:
Inga [223]3 years ago
3 0

Answer:

see explaination

Explanation:

void insertion( int e,int *x, int start, int end)

{

if (e >= x[end])

x[end+1] = e;

else if (start < end)

{

x[end+1] = x[end];

insertion(e, x, start, end-1);

}

else

{

x[end+1] = x[end];

x[end] = e;

}

}

void insertion_recurssion(int *b, int start, int end)

{

if(start < end)

{

insertion_sort_recur(b, start, end-1);

insertion(b[end], b, start, end-1);

}

}

void main()

{

insertion_recurssion(x,0,5);

}

You might be interested in
Describe how pseudocode makes programming more efficient for large programming tasks.
Talja [164]

Answer:Pseudocode helps us understand tasks in a language-agnostic manner. Is it best practice or suggested approach to have pseudocode creation as part of the development lifecycle? For instance:

Identify and split the coding tasks

Write pseudocode

Get it approved [by PL or TL]

Start Coding based on Pseudocode

Explanation: use phrasing tool if you want to write in your own words.

6 0
4 years ago
Read 2 more answers
We cannot create a blank table true or false​
mario62 [17]

I believe that that statement is true

6 0
3 years ago
At some point in your driving career, you will most likely be faced with an oncoming vehicle swerving into your travel lane. tru
aleksley [76]

I believe the answer is True.

7 0
4 years ago
6 external parts or peripherals of a computer system and identify which are output and which are input devices.
djverab [1.8K]
A computer peripheral, or peripheral device, is an external object that provides input and output for the computer. Some common input devices include:

keyboard
mouse
touch screen
pen tablet
joystick
MIDI keyboard
scanner
digital camera
microphone
<span>
Some common Output Devices : 
</span>monitor
projector
TV screen
printer
plotter
<span>speakers</span>
3 0
3 years ago
Which of the following statement is true for Service Request Floods A. An attacker or group of zombies attempts to exhaust serve
klio [65]

Answer:

The answer is "Option A and Option B"

Explanation:

This is a type of attack, which is mainly used to bring down a network or service by flooding large amounts of traffic. It is a high-rate server from legitimate sources, where an attacker or group of zombies is attempting to drain server resources by creating and disconnecting the TCP link, and wrong choices can be described as follows:

In option C, It can't initiate a single request because when the servers were overloaded with legitimate source links, the hacker may then set up and uninstall TCP links.

7 0
3 years ago
Other questions:
  • How do you solve this.
    12·1 answer
  • Widgets are ___________ a. objects b. icons c. functions d. components
    11·1 answer
  • Pick the two statements about packets and routing on the Internet which are true. a. Packets travelling across the Internet take
    13·1 answer
  • A laptop computer communicates with a router wirelessly, by means of radio signals. the router is connected by cable directly to
    10·1 answer
  • How to change the size of my document in cs6?
    13·1 answer
  • For the recursive method below, list the base case and the recursive statement, then show your work for solving a call to the re
    8·1 answer
  • Name the type of software which provides the user interface. [1 mark
    5·1 answer
  • Pls help me!! I will give 35 points and mark brainliest !!!
    10·1 answer
  • Is this a desktop or a computer, or are they the same thing
    12·1 answer
  • Identify the correct answer in each item. Write your answer on the blank provided before
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!