feat(debug): enhance linked list demo with item count and message output
feat(debug): improve GDB pretty-printer support for structured types fix(debug): update dump_debug_graph script to reflect changes in main.cpp feat(visualization): add type hint display to node table visualizer
This commit is contained in:
@@ -55,16 +55,21 @@ private:
|
||||
|
||||
int main() {
|
||||
LinkedList<int> list;
|
||||
|
||||
int count=0;
|
||||
char * message1 = "hello world";
|
||||
// Demonstrate pushing items
|
||||
list.push_front(10);
|
||||
count++;
|
||||
list.push_front(20);
|
||||
count++;
|
||||
list.push_front(30);
|
||||
count++;
|
||||
|
||||
// Demonstrate peeking at the top item
|
||||
if (const int* top = list.peek_front()) {
|
||||
std::cout << "Top element: " << *top << "\n"; // Output: 30
|
||||
std::cout << "Top element: " << *top << "\n"<<"count: "<<count<<"\n"; // Output: 30
|
||||
}
|
||||
std::cout<<message1<<"\n";
|
||||
|
||||
// Demonstrate popping items
|
||||
while (auto value = list.pop_front()) {
|
||||
|
||||
Reference in New Issue
Block a user