I need help with this assignment from start to finish please
I need help with this assignment from start to finish please. This needs to be done in C++. I have put the instructions below and under the instructions is the code that needs to be filled in. Last is the the code that contains the MAIN to run the code to match the output. Thank you.
For this assignment, you must provide
1) a constructor that takes a constant reference to an std::vector and results in a new persistent vector with the same contents. You should copy the contents of the vector into the leaves of the trie.
2) The trie should be composed of std::shared_pointers so that when the persistent vector is destructed, the elements will be automatically destructed (so long as no other copies have been made)
3) A copy constructor that takes a constant reference to another persistent_vector and produces a copy that shares the other vector\'s trie.
4) An assignment operator that takes a constant reference to another persistent_vector and produces a copy that shares the other vector\'s trie.
5) a bracket operator that returns a constant reference to the indexed element.
Your submission should be a single C++ header file that provides the implementation of the persistent vector. Use the attached header file as a starting point.
When finished, running test-1.cpp should yield something like:
persistent_vector of 11 elements with height 3
node 0x7ff331d004a0 : 0x7ff331d00400 0x7ff331d00430
node 0x7ff331d00400 : 0x7ff331d002d0 0x7ff331d00330
node 0x7ff331d002d0 : 0x7ff331d00030 0x7ff331d00090
leaf 0x7ff331d00030 : 0 1
leaf 0x7ff331d00090 : 2 3
node 0x7ff331d00330 : 0x7ff331d00100 0x7ff331d000e0
leaf 0x7ff331d00100 : 4 5
leaf 0x7ff331d000e0 : 6 7
node 0x7ff331d00430 : 0x7ff331d00140 0x0
node 0x7ff331d00140 : 0x7ff331d001b0 0x7ff331d00280
leaf 0x7ff331d001b0 : 8 9
leaf 0x7ff331d00280 : 10
element at index 3 is 3
Where the hexadecimal numbers can be any unique identifier so long as it is possible to reconstruct the tree from the statements. For my implementation, I just printed the value of the pointer to each node as the unique identifier.
THE CODE THAT NEEDS TO BE FILLED IN:
THE MAIN TO RUN THE PROGRAM:
Solution
THE MAIN TO RUN THE PROGRAM:
