Rule of thumb [terminology]
Terminology
Usage
n: size of a one-dimensional sequence
m, n: matrix row and column counts
i, j, k: short-lived generic indices
idx: one explicitly named index
pos: value-to-position mapping
r, c: row and column coordinates
dr, dc: coordinate direction offsets
nr, nc: neighboring row and column
l, r: moving positional boundaries or pointers
lo, hi: lower and upper value bounds
start, end: meaningful interval or substring boundaries
top, bottom, left, right: four rectangular boundaries
mid: midpoint or split position
w, r: write and read indices
x: generic numeric sequence element
val: extracted, stored, or parsed value
a, b: symmetric arithmetic operands
res: constructed return collection
ans: generic final scalar answer
best: optimum found so far
total: additive accumulation
cnt: scalar count
counts: item-to-count mapping
freq: one frequency
freqs: frequency mapping
acc: general non-specific accumulator
profit, gain: domain-specific financial quantities
cur, prev, nxt: current, previous, and next state
prev1, prev2: one and two positions back
node: currently processed node
root, head, tail: structural endpoints
dummy: sentinel node
slow, fast: different-speed pointers
q: single compact BFS queue
stack, heap: preserve data-structure semantics
path: choices in the current backtracking branch
front, back: bidirectional search frontiers
level: nodes or values at one depth
depth: numeric distance from a tree root
seen: previously encountered values or states
visited: graph or grid elements already traversed
used: currently unavailable choices or resources
cand: provisional candidate
prefix, suffix: directional accumulation around an index
rev: reversed representation under construction
digit: one numeric digit
rem: arithmetic remainder
int_part: integer part of a fraction
num_str: string representation of a number
base: current exponentiation base
carry: propagated arithmetic state
partial: incomplete intermediate result
mask: bitwise mask
dist: distance value or distance table
colors: graph-color assignments
original: preserved initial state
ordered: sorted or deliberately arranged state
width: span or merge-run width
size: general element count for a group
parts: pieces that will be joined
alphabet: complete substitution character set