Create a program using C++ language that reassembles the packets contained in a text file (p.txt) and outputs the corresponding message. Your program should use the Ordered List ADT to assist in reassembling the packets in a message. Assume that each packet in the message file contains a position number and three characters from the message. When a communications site transmits a message through a packet-switching network, it does not send the message as a continuous stream of data. Instead, it divides the message into pieces called packets. These packets are sent through the network to a receiving site, which reassembles the message. Packets may be transmitted to the receiving site along different paths. As a result, they are likely to arrive out of sequence. In order for the receiving site to reassemble the message correctly, each packet must include the relative position of the packet within the message. For example, if we break the message “A SHORT MESSAGE" into packets three characters long and follow each packet with a number denoting the packet's position in the message, the result is the following set of packets. A S1 HOR2 T M3 ESS4 AGE5 No matter in what order these packets arrive, a receiving site can correctly reassemble the message by placing the packets in ascending order based on their position numbers.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Using C++ Language (ordered linked list & simply)

don't forget the program should read the text to run

((((((((((((((((need a simple code with using add_sorted and array !!))))))))))))

packet size = 3 array!!

linked list in order

using struct node + class list (simply linked list) + read from file + add_sorted () or ordered

Create a program using C++ language that reassembles the packets contained in a
text file (p.txt) and outputs the corresponding message.
Your program should use the Ordered List ADT to assist in reassembling the packets
in a message.
Assume that each packet in the message file contains a position number and three
characters from the message.
When a communications site transmits a message through a packet-switching
network, it does not send the message as a continuous stream of data. Instead, it
divides the message into pieces called packets. These packets are sent through the
network to a receiving site, which reassembles the message.
Packets may be transmitted to the receiving site along different paths. As a result,
they are likely to arrive out of sequence. In order for the receiving site to reassemble
the message correctly, each packet must include the relative position of the packet
within the message.
For example, if we break the message “A SHORT MESSAGE" into packets three
characters long and follow each packet with a number denoting the packet's position
in the message, the result is the following set of packets.
A S1
HOR2
T M3
ESS4
AGE5
No matter in what order these packets arrive, a receiving site can correctly
reassemble the message by placing the packets in ascending order based on their
position numbers.
Transcribed Image Text:Create a program using C++ language that reassembles the packets contained in a text file (p.txt) and outputs the corresponding message. Your program should use the Ordered List ADT to assist in reassembling the packets in a message. Assume that each packet in the message file contains a position number and three characters from the message. When a communications site transmits a message through a packet-switching network, it does not send the message as a continuous stream of data. Instead, it divides the message into pieces called packets. These packets are sent through the network to a receiving site, which reassembles the message. Packets may be transmitted to the receiving site along different paths. As a result, they are likely to arrive out of sequence. In order for the receiving site to reassemble the message correctly, each packet must include the relative position of the packet within the message. For example, if we break the message “A SHORT MESSAGE" into packets three characters long and follow each packet with a number denoting the packet's position in the message, the result is the following set of packets. A S1 HOR2 T M3 ESS4 AGE5 No matter in what order these packets arrive, a receiving site can correctly reassemble the message by placing the packets in ascending order based on their position numbers.
Expert Solution
steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Knowledge Booster
Linked List Representation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education