Introduction to Programming Concepts with Case Studies in Python [Üçoluk & Kalkan 2012-10-30].pdf

(5012 KB) Pobierz
Introduction to Programming Concepts with Case
Studies in Python
Göktürk Üçoluk
Sinan Kalkan
Introduction
to Programming
Concepts with Case
Studies in Python
1303978953.001.png
Sinan Kalkan
Department of Computer Engineering
Middle East Technical University
Ankara, Turkey
Göktürk Üçoluk
Department of Computer Engineering
Middle East Technical University
Ankara, Turkey
ISBN 978-3-7091-1342-4
ISBN 978-3-7091-1343-1 (eBook)
DOI 10.1007/978-3-7091-1343-1
Springer Wien Heidelberg New York Dordrecht London
Library of Congress Control Number: 2012951836
© Springer-Verlag Wien 2012
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of
the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology
now known or hereafter developed. Exempted from this legal reservation are brief excerpts in connection
with reviews or scholarly analysis or material supplied specifically for the purpose of being entered
and executed on a computer system, for exclusive use by the purchaser of the work. Duplication of
this publication or parts thereof is permitted only under the provisions of the Copyright Law of the
Publisher’s location, in its current version, and permission for use must always be obtained from Springer.
Permissions for use may be obtained through RightsLink at the Copyright Clearance Center. Violations
are liable to prosecution under the respective Copyright Law.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
While the advice and information in this book are believed to be true and accurate at the date of pub-
lication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any
errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect
to the material contained herein.
Printed on acid-free paper
Springer is part of Springer Science+Business Media ( www.springer.com )
Preface
Purpose
This is a book aiming to be an introduction to Computer Science concepts as far
as programming is concerned. It is designed as the textbook of a freshman level
CS course and provides the fundamental concepts and abstract notions for solv-
ing computational problems. The Python language serves as a medium for illustra-
tion/demonstration.
Approach
This book introduces concepts by starting with the Q/A ‘WHY?’ and proceeds by
the Q/A ‘HOW?’. Most other books start with the Q/A ‘WHAT?’ which is then fol-
lowed by a ‘HOW?’. So, this book introduces the concepts starting from the grass-
roots of the ‘needs’. Moreover, the answer to the question ‘HOW?’ is somewhat
different in this book. The book gives pseudo-algorithms for the ‘use’ of some CS
concepts (like recursion or iteration). To the best of our knowledge, there is no other
book that gives a recipe, for example, for developing a recursive solution to a world
problem. In other textbooks, recursion is explained by displaying several recursive
solutions to well-known problems (the definition of the factorial function is the most
famous one) and hoping for the student to discover the technique behind it. That is
why students following such textbooks easily understand what ‘recursion’ is but get
stunned when the time comes to construct a recursive definition on their own. This
teaching technique is applied throughout the book while various CS concepts got
introduced.
This book is authored in concordance with a multi-paradigm approach, which is
first ‘functional’ followed by ‘imperative’ and then ‘object oriented’.
The CS content of this book is not hijacked by a programming language. This
is also unique to this book. All other books either do not use any PL at all or first
introduce the concepts only by means of the PL they use. This entanglement causes
v
vi
Preface
a poor formation of the abstract CS concept, if it does at all. This book introduces
the concepts ‘theoretically’ and then projects it onto the Python PL. If the Python
parts (which are printed on light greenish background) would be removed, the book
would still be intact and comprehensible but be purely theoretical.
Audience
This book is intended for freshman students and lecturers in Computer science or
engineering as a text book of an introductory course frequently named as one of:
– Introduction to Programming
– Introduction to Programming Constructs
– Introduction to Computer Science
– Introduction to Computer Engineering
Acknowledgments
We would like to thank Faruk Polat and I. Hakkı Toroslu from the Middle East
Technical University’s Department of Computer Engineering and Reda Alhajj from
the Department of Computer Science of University of Calgary for their constant
support. We would also like to thank Chris Taylor for her professional proofreading
of the manuscript and our student Rowanne Kabalan for her valuable comments on
the language usage. Moreover, we are very grateful to Aziz Türk for his key help in
the official procedures of publishing the book.
Last but not least, we thank our life partners Gülnur and Gökçe and our families:
without their support, this book would not have been possible.
Department of Computer Engineering,
Middle East Technical University,
Ankara, Turkey
Göktürk Üçoluk
Sinan Kalkan
Zgłoś jeśli naruszono regulamin