Summary
We have successfully built our own data structures in C++ and have found out the time complexity of each data structure. As we have discussed, each data structure has its own strengths and drawbacks. For instance, by using List
, we can access the last element faster than LinkedList
. However, in the List
, removing the first element will take even more time, since we remove the first element since it needs to re-struct the array inside the List
.
In the next chapter, we are going to learn how to build other data structures based on the data structures we have discussed in this chapter. These are stack, queue, and dequeue.