Implementation of a program for serializing and deserializing a doubly linked list from a file of a given format with an additional rand pointer that points to an arbitrary element of the list.
prev— pointer to the previous elementnext— pointer to the next elementrand— pointer to an arbitrary list elementdata— string data (up to 1000 characters, UTF-8)
Text file where each line contains:
<data>;<rand_index>
where rand_index is the index of the node for the rand pointer, or -1 if rand == nullptr.
Example:
apple;2
banana;-1
carrot;1
- Maximum number of nodes: 1,000,000
- Data string length: up to 1000 characters
- UTF-8 support
g++ -std=c++17 -Wall -Wextra -o list_program src/main.cpp src/List.cpp./list_program
- inlet.in — input text file (must be in the project root directory)
- outlet.out — output binary file (created by the program)