C++ Circular Lists, Sentinel Nodes, Merging Lists

Channel:
Subscribers:
2,650
Published on ● Video Link: https://www.youtube.com/watch?v=tpq5_l1g_kg



Duration: 24:11
43 views
0


What if head's previous pointer and tail's next pointer didn't actually point to null?

We cover three possibilities here:
1) Link them together and form a circular linked list
2) Add a sentinel node on each side and use it for iterators and ranged-based for loops
3) Merge two lists together with them