Symbols and units

QuantitySymbolUnitNote
Stored items, array length, tree nodesnncountLocal sizes are nonnegative; tree bounds state n≥1n\ge1.
Operation counts, individual cost, total workqj,cj,Wq_j,c_j,Wcount; steps; stepsCosts exclude unrequested key searches only when a location is supplied.
Stack pushes, pops, capacityP,Q,CP,Q,CcountP−QP-Q is occupancy; circular array capacity uses its own convention.
Catalan numberCnC_ncountOrdered binary shapes or unrestricted stack permutations.
Expression operands, binary operatorsNo,NbN_o,N_bcountBinary operators only.
Queue front and next-free rearf,rf,rindexOne-unused-slot array of length CC.
Activations, peak live frames, Hanoi movesA,D,MA,D,McountInclude base calls in A,DA,D; moves have base zero.
Tree height, node depth, maximum level widthh,d,wth,d,w_tedges; edges; nodesEmpty subtree height −1-1; root depth zero.
Child-count populations, leaves, internal nodesn0,n1,n2,L,In_0,n_1,n_2,L,Icountnin_i counts nodes with ii children.
Full-tree branching factorbbchildren/nodeAt least two; digit-base use also defined locally.
Node, children, subtree size, value and sumv,vL,vR,s(v),k(v),a(v)v,v_L,v_R,s(v),k(v),a(v)node; count; value unitsh(v)h(v) subtree height; ∅\varnothing empty subtree.
Cycle prefix and cycle lengthμ,λ\mu,\lambdalinksFloyd pointer traversal.
Integer dividend, divisor, quotient, remaindera,b,q,ra,b,q,r1C division truncates toward zero; use local meanings outside arithmetic.
Unsigned value, word width, bit/shift indexu,w,ku,w,k1; bits; countww is value-bit width in arithmetic; array ww below is byte width.
Invariant inputs and statex,y,X,Y,z,a,bx,y,X,Y,z,a,b1Division x=qy+rx=qy+r; power XY=zabX^Y=za^b.
Polynomial coefficients, degree, argument, accumulatoraj,d,x,vja_j,d,x,v_j1Numeric program values; Horner order begins with highest-degree coefficient.
Affine update constants, state, iterationsa,b,zj,ka,b,z_j,k1; countzj+1=azj+bz_{j+1}=az_j+b.
Base address, element widthB,wB,wbyte address; bytes/elementAddress expressions state contiguous layout.
Row/column counts and lower boundsnr,nc,Lr,Lc,Ln_r,n_c,L_r,L_c,Lcount; indexGeneral arrays may have nonzero lower bounds; C uses zero.
Dimension count, dimension lengths and indicesd,Ns,ir,j,kd,N_s,i_r,j,kcount; indexkk also zero-based packed offset, locally specified.
Prefix sum, range endpoints, number of subarraysPi,l,r,NsubP_i,l,r,N_{\mathrm{sub}}value units; index; countNonempty contiguous subarrays.
Rooted BST, subtrees, left size and insertion ordersT,TL,TR,ℓ,W(T)T,T_L,T_R,\ell,W(T)tree; countDistinct keys; W(T)W(T) differs from total work WW.
Range-query output countkkkeysO(h+k+1)O(h+k+1) reporting time.
AVL balance, minimum size, Fibonacci numbersbf⁡,N(h),Fj\operatorname{bf},N(h),F_jcountBalance is left height minus right; F0=0,F1=1F_0=0,F_1=1.
Heap count and last-level populationH(n),tH(n),tcountt=n−(2h−1)t=n-(2^h-1); heap left size ℓ\ell.
Graph, vertices, edges, sizes, outdegreeG,V,E,nv,ne,deg⁡+(v)G,V,E,n_v,n_e,\deg^+(v)set; countIn this context EE is an edge set; expectation is written E[⋅]E[\cdot].
Python integer division conventiona,b,q,ra,b,q,r1Same dividend/divisor/quotient/remainder roles; Python uses floor division, unlike C truncation.

Revise offline: the whole Programming and Data Structures handbook as one PDF

55 pages · 2.6 MBFree to read online. Sign in to download the PDF.We save the handbook, version and request time in My downloads. Privacy policy

All chapters · Corrections