C++: Debugging Linked Lists using Invariants
Channel:
Subscribers:
2,650
Published on ● Video Link: https://www.youtube.com/watch?v=-DCtgAneTEc
Class Invariants aren't just rules for your class that must always be true (though they are that), they are very useful guides when you're writing or debugging code. You can ask yourself, for each invariant, if you're preserving it correctly, and a lot of the time you'll be like oh, wait, yeah, I forgot that one and fix your code even before you begin testing it.
Today we looked at some student code for push_front and pop_back in a singly linked list, and talked about the various problems with it. Learning through debugging is different than from just watching someone solve the problem directly, but is still very useful.
Other Videos By Bill Kerney
2024-03-04 | C++: Templated Stacks and Queues |
2024-03-02 | Queues and Stacks |
2024-03-02 | C++: Debugging Linker Errors |
2024-02-28 | C++: Dynamic Cast |
2024-02-28 | CSCI 1: Fallacies and Midterm I Review |
2024-02-26 | C++ Circular Lists, Sentinel Nodes, Merging Lists |
2024-02-26 | C++: Keywords You Might Not Know |
2024-02-23 | C++ Inheritance |
2024-02-21 | C++ Smart Pointers |
2024-02-14 | C++: Inserting into a Linked List |
2024-02-12 | C++: Debugging Linked Lists using Invariants |
2024-02-09 | Lab Time: Make a Makefile |
2024-02-07 | C++ Linked Lists |
2024-02-05 | C++: Operators and Type Conversion with Constructors |
2024-02-03 | C++ Test Driven Development using Gtest |
2024-02-03 | Managing Computer Science Projects is Hard |
2024-01-31 | Big O Notation |
2024-01-31 | C++ Operators |
2024-01-29 | C++ Timing Code, Benchmarking, UNIX Shell Scripting Automation |
2024-01-26 | Make a Makefile |
2024-01-24 | C++: Adding Iterator Support to our Vector Class |