How to think like a computer scientist
C++ Version, First EditionCopyright (C) 1999 Allen B. DowneyThis book is an Open Source Textbook (OST). Permission is granted toreproduce, store or transmit the text of this book by any means, electrical,mechanical, or biological, in accordance with the terms of the GNU GeneralPublic License as published by the Free Software Foundation (version 2).This book is distributed in the hope that it will be useful, but WITHOUTANY WARRANTY; without even the implied warranty of MERCHANTABIL-ITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU GeneralPublic License for more details.The original form of this book is LaTeX source code. Compiling this LaTeXsource has the eﬀect of generating a device-independent representation of atextbook, which can be converted to other formats and printed. All intermediaterepresentations (including DVI and Postscript), and all printed copies of thetextbook are also covered by the GNU General Public License.The LaTeX source for this book, and more information about the OpenSource Textbook project, is available from
or by writing to Allen B. Downey, 5850 Mayﬂower Hill, Waterville, ME 04901.The GNU General Public License is available from www.gnu.org or by writ-ing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,MA 02111-1307, USA.This book was typeset by the author using LaTeX and dvips, which are bothfree, open-source programs.