Skip to content

Add answer key for Debugging workshop#646

Open
beagandica wants to merge 1 commit into
NuevoFoundation:masterfrom
beagandica:content/answer-key-debugging
Open

Add answer key for Debugging workshop#646
beagandica wants to merge 1 commit into
NuevoFoundation:masterfrom
beagandica:content/answer-key-debugging

Conversation

@beagandica
Copy link
Copy Markdown
Member

Summary

Complete answer key for the C Debugging workshop covering all tutorial bugs and three algorithm exercises.

Changes

New file: \content/english/debugging/answer-key.md\

Tutorial section (bugs already shown in expand blocks, now consolidated):

  • Binary Search - Recursive call searched upper half instead of lower half
  • Quicksort - Missing \p1++\ after swap in partition loop
  • Vector memory - Forgot to update \list->__arr\ after realloc

Exercise solutions (correct implementations):

  1. Binary Tree - treeAdd, treeRemove (3 cases: 0/1/2 children), findMin with sentinel node
  2. Binary Heap - heapAdd (sift up) and heapRemoveMax (sift down) for 1-indexed max heap
  3. Burrows-Wheeler Transform - Suffix array construction + safe modulo pattern

Teacher resources:

  • Common bugs to watch for per exercise
  • GDB and Valgrind quick reference table
  • C remainder vs modulo operator warning

Languages affected

  • English (primary)
  • Brazilian Portuguese translation exists (C code is language-agnostic)

Testing

  • Hugo build passes
  • All language versions checked
  • 10-model QA passed (3 clean passes)
  • Follows answer key format (hidden: true, weight: 15)

Note

Exercise implementations are based on the algorithm descriptions in the workshop. The Replit links (Exercise 1-3) returned 404 during development — the exercise environments may need to be verified separately.

Covers all tutorial bugs and three C algorithm exercises:

Tutorial section (consolidated from inline expand blocks):
- Binary Search: recursive call searched upper half instead of lower half
- Quicksort: missing p1++ after swap in partition loop
- Vector: forgot to update list->__arr after realloc

Exercise 1 - Binary Tree: correct treeAdd, treeRemove (3 cases),
findMin implementations with sentinel node pattern
Exercise 2 - Binary Heap: correct heapAdd (sift up) and heapRemoveMax
(sift down) for 1-indexed max heap array
Exercise 3 - Burrows-Wheeler Transform: suffix array construction +
safe modulo pattern for C remainder operator pitfall

Also includes:
- Common bugs to watch for per exercise
- GDB and Valgrind quick reference table
- Note about C remainder vs modulo operator

PT-BR translation exists. C code is language-agnostic.
10-model QA passed (3 clean passes). Hugo build verified.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@beagandica beagandica force-pushed the content/answer-key-debugging branch from 87da355 to df93db4 Compare April 29, 2026 02:11
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.

1 participant