Skip to content

Fix C++ deque demo and Deque/Dequeue title - #1160

Merged
pearcej merged 2 commits into
pearcej:masterfrom
wrigjl:fix-deque-demo
Oct 12, 2026
Merged

pearcej merged 2 commits into
pearcej:masterfrom
wrigjl:fix-deque-demo

Conversation

@wrigjl

@wrigjl wrigjl commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

In ImplementingaDequeCpp.ptx, the C++ deque demo had return 0; inside the final for loop, so after the pops only the first remaining item ("Turtle") was printed instead of the whole deque.

  • Move the loop's closing brace above return 0;
  • Add a trailing cout << endl; to match the first print loop
  • Fix "Itm at the back" typo
  • Retitle the exploration "Deque Implementation" (was "Dequeue", which is the queue operation, not the data structure)

Verified by extracting the program, compiling with -Wall (clean), and running it; the final line is now Turtle Zebra Catfish, matching the Python version.

... You can tell exactly where I am in the material this semester =)

wrigjl and others added 2 commits October 12, 2026 08:29
The return statement was inside the final for loop, so only the first
remaining item was printed. Move it after the loop, add a trailing
newline, and fix the "Itm" typo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Dequeue" is the queue removal operation; the data structure is a deque.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wrigjl wrigjl changed the title Fix early return in C++ deque demo Fix C++ deque demo and Deque/Dequeue title Oct 12, 2026

@pearcej pearcej left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't beleive I missed this! Thanks!

@pearcej
pearcej merged commit d0ad881 into pearcej:master Oct 12, 2026
2 checks passed
@wrigjl
wrigjl deleted the fix-deque-demo branch October 12, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants