...

/

Feature #2: Serialize and Deserialize Participant Data

Feature #2: Serialize and Deserialize Participant Data

Implementing the "Serialize and Deserialize Participant Data" feature for our "Zoom" project.

Description

Like in the previous feature, the participant data of a Zoom session is maintained using a binary search tree. This is beneficial because the sorted order of names on the display does not change even when participants join or leave the meeting. We’ll assume that this binary search tree is maintained on both the server and client sides. However, while transmitting this information back and forth, we also want to serialize the data, send it from the server to the client, and then deserialize the data received by the client into a BST. Therefore, we need to create two modules: a serializer that deserializes the data before sending it through the network and a deserializer that translates the serialized data into its original form.

There are many ways to represent a serialized representation of a binary search tree. All that matters is that it is optimized.

Let’s look at an example of serializing a binary search tree. Suppose we are given the following tree as input:

%0 node_1 Jeanette node_2 Elia node_1->node_2 node_3 Latasha node_1->node_3 node_1606768083767 Albert node_2->node_1606768083767 node_1606686874049 Elvira node_2->node_1606686874049 node_1606687141114 Kandice node_3->node_1606687141114 node_1606687204633 Maggie node_3->node_1606687204633
Example of BST containing participant data

The serializer will take the root of this BST as an input and return a string, which is the serialized form. This string can be (but is not limited to): Jeanette, Elia, Albert, Elvira, Latasha, Kandice, Maggie. Then, the deserializer will take this string as input and return the root as a BST containing all the ...

Access this course and 1400+ top-rated courses and projects.