Algorithms: A Top-Down Approach

Similar documents
GACE Computer Science Assessment Test at a Glance

WSU Five-Year Program Review Self-Study Cover Page

Radius STEM Readiness TM

Mathematics. Mathematics

Diagnostic Test. Middle School Mathematics

Self Study Report Computer Science

University of Groningen. Systemen, planning, netwerken Bosman, Aart

South Carolina English Language Arts

THE UNIVERSITY OF SYDNEY Semester 2, Information Sheet for MATH2068/2988 Number Theory and Cryptography

EECS 700: Computer Modeling, Simulation, and Visualization Fall 2014

Given a directed graph G =(N A), where N is a set of m nodes and A. destination node, implying a direction for ow to follow. Arcs have limitations

12-WEEK GRE STUDY PLAN

B. How to write a research paper

BADM 641 (sec. 7D1) (on-line) Decision Analysis August 16 October 6, 2017 CRN: 83777

Math 181, Calculus I

Introduction and Motivation

Course Content Concepts

SOUTHERN MAINE COMMUNITY COLLEGE South Portland, Maine 04106

Multimedia Application Effective Support of Education

arxiv: v1 [math.at] 10 Jan 2016

16 WEEKS STUDY PLAN FOR BS(IT)2 nd Semester

RANKING AND UNRANKING LEFT SZILARD LANGUAGES. Erkki Mäkinen DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF TAMPERE REPORT A ER E P S I M S

AU MATH Calculus I 2017 Spring SYLLABUS

Constructing a support system for self-learning playing the piano at the beginning stage

Introduce yourself. Change the name out and put your information here.

On the Polynomial Degree of Minterm-Cyclic Functions

Lecture Notes on Mathematical Olympiad Courses

Fountas-Pinnell Level P Informational Text

Spring 2015 IET4451 Systems Simulation Course Syllabus for Traditional, Hybrid, and Online Classes

Characteristics of the Text Genre Realistic fi ction Text Structure

CS 101 Computer Science I Fall Instructor Muller. Syllabus

RIGHTSTART MATHEMATICS

Fountas-Pinnell Level M Realistic Fiction

TabletClass Math Geometry Course Guidebook

What the National Curriculum requires in reading at Y5 and Y6

Instructor: Matthew Wickes Kilgore Office: ES 310

Artificial Neural Networks written examination

AP Calculus AB. Nevada Academic Standards that are assessable at the local level only.

Analysis of Enzyme Kinetic Data

Designing a Computer to Play Nim: A Mini-Capstone Project in Digital Design I

Lecture 1: Machine Learning Basics

Characterizing Mathematical Digital Literacy: A Preliminary Investigation. Todd Abel Appalachian State University

(I couldn t find a Smartie Book) NEW Grade 5/6 Mathematics: (Number, Statistics and Probability) Title Smartie Mathematics

We are strong in research and particularly noted in software engineering, information security and privacy, and humane gaming.

Technical Manual Supplement

Shockwheat. Statistics 1, Activity 1

Remainder Rules. 3. Ask students: How many carnations can you order and what size bunches do you make to take five carnations home?

ECE (Fall 2009) Computer Networking Laboratory

Exploration. CS : Deep Reinforcement Learning Sergey Levine

CSC200: Lecture 4. Allan Borodin

The Indices Investigations Teacher s Notes

Math Techniques of Calculus I Penn State University Summer Session 2017

KENTUCKY FRAMEWORK FOR TEACHING

School of Innovative Technologies and Engineering

WHY SOLVE PROBLEMS? INTERVIEWING COLLEGE FACULTY ABOUT THE LEARNING AND TEACHING OF PROBLEM SOLVING

Theory of Probability

Honors Mathematics. Introduction and Definition of Honors Mathematics

Marketing Management

Penn State University - University Park MATH 140 Instructor Syllabus, Calculus with Analytic Geometry I Fall 2010

Class Meeting Time and Place: Section 3: MTWF10:00-10:50 TILT 221

Characteristics of the Text Genre Informational Text Text Structure

OPTIMIZATINON OF TRAINING SETS FOR HEBBIAN-LEARNING- BASED CLASSIFIERS

Livermore Valley Joint Unified School District. B or better in Algebra I, or consent of instructor

Math-U-See Correlation with the Common Core State Standards for Mathematical Content for Third Grade

Using the Attribute Hierarchy Method to Make Diagnostic Inferences about Examinees Cognitive Skills in Algebra on the SAT

Computer Science (CS)

Manipulative Mathematics Using Manipulatives to Promote Understanding of Math Concepts

Answers To Hawkes Learning Systems Intermediate Algebra

Syllabus ENGR 190 Introductory Calculus (QR)

An Effective Framework for Fast Expert Mining in Collaboration Networks: A Group-Oriented and Cost-Based Method

BPS Information and Digital Literacy Goals

S T A T 251 C o u r s e S y l l a b u s I n t r o d u c t i o n t o p r o b a b i l i t y

DIGITAL GAMING & INTERACTIVE MEDIA BACHELOR S DEGREE. Junior Year. Summer (Bridge Quarter) Fall Winter Spring GAME Credits.

TABLE OF CONTENTS TABLE OF CONTENTS COVER PAGE HALAMAN PENGESAHAN PERNYATAAN NASKAH SOAL TUGAS AKHIR ACKNOWLEDGEMENT FOREWORD

Qualification handbook

Pragmatic Use Case Writing

Circuit Simulators: A Revolutionary E-Learning Platform

ISFA2008U_120 A SCHEDULING REINFORCEMENT LEARNING ALGORITHM

Math 098 Intermediate Algebra Spring 2018

Python Machine Learning

PROGRAM AND EXAMINATION REGULATIONS FOR THE MASTER S PROGRAM IN INDUSTRIAL AND APPLIED MATHEMATICS

Ohio s Learning Standards-Clear Learning Targets

Math Pathways Task Force Recommendations February Background

PROGRESS MONITORING FOR STUDENTS WITH DISABILITIES Participant Materials

Page 1 of 11. Curriculum Map: Grade 4 Math Course: Math 4 Sub-topic: General. Grade(s): None specified

Discriminative Learning of Beam-Search Heuristics for Planning

Group Assignment: Software Evaluation Model. Team BinJack Adam Binet Aaron Jackson

Computer Science is more important than Calculus: The challenge of living up to our potential

MTH 141 Calculus 1 Syllabus Spring 2017

Intermediate Algebra

Julia Smith. Effective Classroom Approaches to.

Improving Conceptual Understanding of Physics with Technology

EDEXCEL FUNCTIONAL SKILLS PILOT. Maths Level 2. Chapter 7. Working with probability

Specification of the Verity Learning Companion and Self-Assessment Tool

What is PDE? Research Report. Paul Nichols

A Version Space Approach to Learning Context-free Grammars

Digital Fabrication and Aunt Sarah: Enabling Quadratic Explorations via Technology. Michael L. Connell University of Houston - Downtown

Liquid Narrative Group Technical Report Number

(Sub)Gradient Descent

Copyright Corwin 2015

Transcription:

Algorithms: A Top-Down Approach Rodney R. Howell Dept. of Computing and Information Sciences Kansas State University Manhattan, KS USA Ninth Draft

This textbook was prepared with L A TEX2ε. Figures were prepared using X fig and gnuplot. Copyright c 2009 by Rodney R. Howell. All rights reserved. No portion of this text may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the author. Permission is hereby granted to students of Kansas State University to print, photocopy, or store electronically this draft of this text for their own academic use. i

Preface This book gives an introduction to the design and analysis of algorithms. It is intended to introduce the reader to the theories of algorithm correctness and performance analysis, as well as to give a broad overview of algorithm design techniques. As the proper organization of data is essential to the efficiency of many algorithms, a significant portion of the text is devoted to design and analysis of data structures. This book is motivated in part by the author s belief that people do not fully understand an algorithm until they are able to prove its correctness. For this reason, all of Chapter 2 and much of Chapter 4 are devoted to techniques for proving correctness. Outside of these two chapters, however, very few correctness proofs are given, as they would needlessly clutter the presentation with tedious details. Instead, all algorithms are presented in such a way as to facilitate a correctness proof. The particular approach used is top-down. This approach fits well with mathematical techniques of induction, proving loop invariants, and applying previously-shown theorems. By having an understanding of the mechanics of proving correctness, readers are equipped to gain a thorough understanding of an algorithm presented in a top-down way. Correct use of notation, particularly asymptotic notation, is emphasized throughout. Although asymptotic notation is routinely abused in the literature, the author s experience is that students find such abuse confusing and misleading. As others have argued, nothing is gained by this abuse, so it is avoided in this book. Algorithms are presented in a pseudo language defined with enough rigor to facilitate both performance analyses and correctness proofs. The essence of an algorithm is not tied to a particular programming language; hence, we have chosen a computational model and corresponding notation that we feel are appropriate for communicating algorithms to humans. This text contains sufficient material for both an advanced undergraduate course and an introductory graduate-level course on the design and ii

iii analysis of algorithms. Prerequisite Material This book is intended to be reasonably self-contained. However, a certain degree of maturity is assumed regarding the audience. Readers are expected to have enough experience in writing programs so as to be able to understand algorithms presented in a pseudo language. Experience with basic data structures, including stacks, queues, lists, and trees, will be helpful, as will experience in manipulating finite and infinite sums, solving recurrences, and performing combinatorial analyses. Though calculus and number theory are used occasionally, background in these fields of study is not assumed. Organization The outline of this book is as follows: I. Fundamentals the foundational material upon which the remainder of the text is based. 1. Introduction introduction to the ideas of specification, correctness, and analysis of algorithms, as well as to the top-down approach. 2. Proving Algorithm Correctness introduction to techniques for proving algorithm correctness. 3. Analyzing Algorithms introduction to asymptotic notation and its use in analyzing worst-case performance of algorithms. II. Data Structures data structures commonly used with algorithms, including algorithms presented later in this text. 4. Basic Techniques techniques for reasoning about and analyzing data structures. A more detailed discussion of the computational model and notation is presented. Amortized analysis is introduced. 5. Priority Queues binary heaps, leftist heaps, skew heaps, and randomized heaps. Randomized algorithms and expected-case analysis are introduced. 6. Storage/Retrieval I: Ordered Keys ordered arrays, binary search trees, AVL trees, splay trees, and skip lists.

iv 7. Storage/Retrieval II: Unordered Keys virtually initialized arrays and hashing, including universal hashing. 8. Disjoint Sets structures for supporting Merge and Find operations on disjoint sets. 9. Graphs introduction to graph theory and implementations of graphs. III. Algorithm Design Techniques an in-depth look at standard algorithmic design techniques. 10. Divide and Conquer algorithms for sorting, selecting the kth smallest, multiplying polynomials, and multiplying/dividing integers. 11. Optimization I: Greedy Algorithms algorithms for finding a minimum-cost spanning tree, finding shortest paths, scheduling, and generating Huffman codes. 12. Optimization II: Dynamic Programming algorithms for finding shortest paths, optimal ordering of chained matrix multiplication, and knapsack problems. IV. Common Reduction Targets algorithms for problems to which many other problems can be reduced. 13. Depth-First Search algorithms for topological sort, articulation points, and strongly connected components. 14. Network Flow and Matching a study of network flow algorithms and their applications. 15. * The Fast Fourier Transform a study of the Fast Fourier Transform algorithm and its application to problems such as integer multiplication. V. Intractable Problems dealing with problems for which we cannot find efficient solutions. 16. N P-Completeness an introduction to the theory of N P-completeness, including proofs of N P-completeness. 17. Approximation Algorithms an introduction to design and analysis of approximation algorithms for N P-complete problems.

v Sections which may be omitted due to more mathematical content have titles prefixed with a. An undergraduate course would consist of all of Part I (except Section 3.11) and most of Parts II and III. Parts IV and V are targeted more for graduate students, though selected topics could be used in an undergraduate course. A graduate-level course should also include all of Part I (though it could probably be covered rather quickly) and perhaps selected topics from Part II. The core of this course would come from Part III, supplemented by some or all of Parts IV and V. Exercises Each chapter includes a section of exercises intended to reinforce the chapter material. Some of the exercises are more challenging, and are therefore marked with or to indicate their level of difficulty. Exercises marked will be challenging for most undergraduates, and exercises marked will be challenging for most graduate students. Web Site This textbook, as well as various supplemental materials, may be accessed online at www.cis.ksu.edu/ rhowell/algorithms-text/ The textbook itself requires a password if accessed from outside the ksu.edu domain. All other materials are publicly available. Feedback Your feedback is most welcome. Please send corrections, questions, comments, and/or suggestions to the author at rhowell@ksu.edu