Trace Flowcharts

What Is a Trace Table?

A trace table is a tabular tool used to manually record the values of variables and the flow of control at each step of an algorithm.

It helps in debugging and understanding program logic by showing exactly how data changes as the algorithm executes.

What Is a Flowchart?

A flowchart is a visual representation of an algorithm, depicting the sequence of operations step by step.

It helps in understanding the execution flow, tracking variable changes, and predicting program output.

Rules for Creating a Trace Table {NOT PASSED}

  1. In a table, create one column for each variable used in the algorithm and one for any output.
  2. Record all variable values and outputs in the same row for each step, showing exactly how data changes.
  3. If there is no output, leave that cell blank; similarly, if a variable does not have a value change, leave that blank, too.
  4. Move to the next row only when progressing to the next statement or loop iteration.
  5. Use clear headings (e.g. i, sum, result) for readability.
  6. Optionally, highlight row groups for loops or conditional branches to track repeated execution.

Standard Flowchart Symbols

Symbol Purpose Example
Start/EndIndicates the beginning or end of a flowchart.Start End Symbol
Process/OperationRepresents an instruction or action in the process.Process Symbol
DecisionUsed to represent a decision-making step (Yes/No).Decision Symbol
Input/OutputRepresents an input (e.g. user input) or an output.Input Output Symbol
FlowlineIndicates the direction of flow within the chart.Flowline Symbol
ConnectorUsed to connect different parts of a flowchart.Connector Symbol

Example Flowcharts & Trace Tables

Switch between examples, then view the flowchart or the corresponding trace table.

This flowchart reads two numbers and outputs the larger value.

Largest Number Flowchart

Trace for inputs A = 5 and B = 7.

ABOutputNote
57 No output yet when A and B are entered.
7 A and B do not change after the decision; the larger value (7) is output.

Reads 6 integers and outputs how many are greater than 1000.

Count Big Numbers Flowchart

Input sequence: 1200, 800, 3000, 500, 1001, 1000.

Step num (input) num > 1000? bigNums count count ≥ 0 ? Output
Init05
11200Yes14Yes → loop
2800No13Yes → loop
33000Yes22Yes → loop
4500No21Yes → loop
51001Yes30Yes → loop
61000No3-1No → stop
End3-13

Challenges in Flowchart Tracing

  • Understanding Decision Points: Identifying which path the logic follows when multiple outcomes exist.
  • Complex Execution Flow: Large or nested flowcharts can be hard to navigate without clear labels.
  • Mapping to Code: Translating diagram symbols into correct programming constructs requires attention to detail.

 Key Takeaways

  • A trace table records variable values and control flow for each step, aiding manual debugging.
  • A flowchart diagrams an algorithm’s sequence, making logic easier to follow visually.
  • Key flowchart symbols include Start/End, Process, Decision, Input/Output, Flowline, and Connector.
  • Combining trace tables with flowcharts provides a clear roadmap and detailed insight into algorithm behavior.
  • Using these tools helps validate logic, identify errors early, and communicate designs effectively.