Previous Section Table of Contents Next Section

Appendix B. Index of Bugs by Type

As previously mentioned, bugs can appear multiple times in this list because the classification is somewhat fluid. Each bug is listed by title, with the language and number of the page on which it appears.

A.off-by-one. The program makes a calculation that is off by one.

Language

Title

Page Number

C

Memory Free

60

C

Kanji Backspace

71

Python

Alphabetize Words

90

Python

Print the Month and Day

95

Java

Convert a Number to Text

133

Perl

Sort a File by Line Length

179

X86 Assembly

Check if Two Words Are Anagrams

238

X86 Assembly

Radix Exchange Sort

260


A.logic. The algorithm has a logical flaw.

Language

Title

Page Number

C

Selection Sort

41

C

Memory Copy

50

C

Memory Allocator

56

Python

Parse Numbers Written in English

110

Python

Assign Gift Givers

113

Java

Quicksort

149

Perl

Print the Prime Factors of a Number

182

Perl

Tab Expansion

184

Perl

Find Repeating Parts of a Fraction

190

Perl

Play the Game Mastermind

207

x86 Assembly

Multiply Two Numbers Using Shifts

230

x86 Assembly

Play the Simulation Game Life

251


D.index. An array is indexed into incorrectly.

Language

Title

Page Number

C

Memory Free

60

Python

Find a Substring

87

Java

Convert a Number to Text

133


D.limit. Processing is done incorrectly at the beginning or end of the data.

Language

Title

Page Number

C

Recursive Word Reversal

64

Python

Is a Number Prime?

85

Java

Reverse a Linked List

143

Perl

Simple Database

187

x86 Assembly

Check if Two Words Are Anagrams

238

x86 Assembly

Radix Exchange Sort

260


D.number. A bug related to how numbers are stored in memory.

Language

Title

Page Number

x86 Assembly

Make Change for a Dollar

227

x86 Assembly

Sum a Signed Array

247


F.init. A variable is not properly initialized.

Language

Title

Page Number

C

Parse a String into Substrings

53

Java

Is a Year a Leap Year?

129

Java

Play the Game Pong, Part II

157

Perl

Sort All the Files in a Directory Tree

196

x86 Assembly

Convert a 64-Bit Number to a Decimal String

242


F.missing. A necessary statement is missing.

Language

Title

Page Number

C

Linked List Removal

47

x86 Assembly

Join Strings with a Delimiter

232


F.location. A statement is in the wrong place.

Language

Title

Page Number

C

Calculate All Possible Routes

68

Python

Go Fish, Part II: Ask if Another Hand Has a Card

102

Java

Draw a Triangle on the Screen, Part II

140

Java

Check if a List Has a Loop

146

Perl

Calculate Student Test Averages

200

x86 Assembly

Multiply Two Numbers Using Shifts

230


B.variable. The wrong variable name is used.

Language

Title

Page Number

C

Selection Sort

41

C

Linked List Insertion

44

Python

Go Fish, Part III: Play a Full Game

105

Java

Draw a Triangle on the Screen, Part I

136

Java

Compute Bowling Scores

161

Perl

Merge Sort of Multiple Files

203

x86 Assembly

Calculate Fibonacci Numbers

235


B.expression. The calculation of an expression has a mistake.

Language

Title

Page Number

Python

Encode Strings Using a Character Map

92

Python

Go Fish, Part I: Draw a Card from a Deck

98

Java

Draw a Triangle on the Screen, Part II

140

Java

Play the Game Pong, Part I

153

Perl

Simple Database

187

Perl

Find Repeating Parts of a Fraction

190

Perl

Expand Indented File List to Full Paths

193

Perl

Play the Game Mastermind

207

x86 Assembly

Check if Parentheses Match in Source Code

255


    Previous Section Table of Contents Next Section