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

When a message is sent over the Internet. Before the message is sent, it is brok

ID: 3572032 • Letter: W

Question

When a message is sent over the Internet. Before the message is sent, it is broken into data packets. These packets are numbered consecutively, but they are out of order during transfer over the network. In order for the messagesd to be read it needs to be sequenced. In 300 words discuss how you would sort these packets with bubble sort and merge sort algorithms, explaining why you chose these two kinds of algorithm. Use numbers to demonstrate how these algorithms work. Hint: Create a series of numbers to represent the data packets

Explanation / Answer

It would be better if we also include the ending and starting acknowledgement of packet sending from the source. The reason for doing so is we can count the number of packets which the source sends and the number of packets receiver received.

Once done, the bobble or merge sort algorithm will be called by passing the array of elements and will be sorted based on the packet numbers, packet with number 1 will be sorted at the position number 0 and the last packet will be placed on the last position.

It is also necessary to pay attention at the running time of these two algorithms in each scenario because while sending large files which include thousands of packets, the optimized performance is very crucial to sort the packets.

We know that merge sort is much better than bubble sort so it is quite obvious that the choice for sorting will be merge sort.

Now after sorting the packets and receiving the information from the packets we will came to know what information is passed from the sender and what information we receives.

Following example will explain better what exactly will happen.

Suppose we send 150 packets at random and similarly the receiver receives 150 packets at random. Now after getting the final received acknowledgement from the sender, the merge sort will be called and before that all the packets received will be added to a list.

The list which is passed to the merge sort will now starts rearranging the packets in ascending order, here it is necessary to specify the order of sorting because by doing so the sorting algorithm will work, now suppose a situation where the packets are arranged in reverse order, this will destroy the original information.

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