实例介绍
Computer Science An Interdisciplinary Approach 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
This page intentionally left blank Computer ● S cience An Interdisciplinary approach Robert sedgewick Kevin Wayne Princeton universit aDdison- Wesley Boston Columbus. Indianapolis. New York. San Francisco Amsterdam Cape Town Dubai· London· Madrid· Milan· Munich· Paris: Montreal· Toronto. Delhi· Mexico city Sao paulo· Sydney Hong Kong· Seoul· Singapore. Taipei· Tokyo as trademarks. Where those deaa -y manufacturers and sellers to distinguish their products are claimed Many of the designations used by ignations appear in this book, and the publisher was aware of a trade mark claim, the designations have been printed with initial capital letters or in all capitals The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. no liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. For information about buying this title in bulk quantities, or for special sales opportunities(which may include electronic versions; custom cover designs; and content particular to your business, train ing goals, marketing focus, or branding interests), please contact our corporate sales department at corpsales@pearsoned con or(800)382-3419 For government sales inquiries, please contact governmentsalesapearsoned com ForquestionsaboutsalesoutsidetheUnitedStates,pleasecontactintics@peArson.com Visit us on the Web: informit. com/aw Library of Congress Control Number: 2016936496 Copyright o 2017 Pearson Education, Inc All rights reserved. Printed in the United States of America. This publication is protected by copy- right, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical photocopying, recording, or likewise. For information regarding permissions, request forms, and the appropriate contacts within the Pearson Education Global Rights Permissions Department, please visitwww.pearsoned.com/permissions/. ISBN-13:978-0-13-407642-3 ISBN-10:0-13-407642-7 216 To Adam, Andrew, Brett, robbie Henry, lona, Rose, Peter, and especially linda To Jackie, Alex, and michael Contents Preface 7-Elements of Programming 1.1 Your First Program 1.2 Built-in Types of data 1.3 Conditionals and Loops 1. 4 Arrays 90 1.5 Input and Output 126 1.6 Case Study: Random Web Surfer 170 2-Functions and modules 797 2.1 Defining Functions 192 2. 2 Libraries and clients 226 R excursion 262 2.4 Case Study: Percolation 300 3-Object-Oriented Programming 329 3.1 Using Data Types 330 3.2 Crcating Data Types 382 3.3 Designing Data Typ 428 3.4 Case Study: N-Body Simulation 4--Algorithms and Data Structures 493 4.1 Performance 494 4.2 Sorting and Searching 532 4.3 Stacks and Queues 566 4.4 Symbol Tables 624 4.5 Case Study: Small-World Phenomenon 670 5--Theory of computing 775 1 Formal Languages 718 5.2 Turing machines 766 5.3 niversality 786 5.4 Computability 806 5.5 Intractabili 822 6-A Computing Machine 873 6.1 Representing Information 874 6.2 TOY Machine 906 6.3 Machine-Language Programming 930 6.4 ToY Virtual machine 958 7--Building a Computing Device 985 7. 1 Boolean logic 986 7.2 Basic Circuit model 1002 7. 3 Combinational circuits 1012 7.4 Sequential Circuits 1048 7.5 Digital Devices 1070 Context 7093 Glossary 7097 Index 707 APIs 7739 ProgRams Elements of programming Functions and modules Your First program Defining functions 1.1.1 Hello, World 4 2.1.1 Harmonic numbers(revisited) 194 1. 1. 2 USing a command-line argument 7 2. 1.2 Gaussian functions 203 Built-in Types of data 2.1.3 Coupon collector(revisited).. 206 1. 2.1 String concatenation 20 2.1.4 Play that tune (revisited) 213 1.2.2 Integer multiplication and division 23 Libraries and Clients 1.2.3 Quadratic formula 25 2.2.1 Random number library 234 1.2.4 Leap year 28 2.2.2 Array I/o librar 238 1. 2.5 Casting to gct a random integer.. 34 2.2.3 Itcratcd function systcms 241 Conditionals and loops 2.2.4 Data analysis library. 245 1.3.1 Flipping a fair coin 53 2.2.5 Plotting data values in an array 247 1.3.2 Your first while loop 2.2.6 Bernoulli trials 250 1.3.3 Computing powers or2 5 57 Recursion 1.3.4 Your first nested loops 63 2.3. 1 Euclids algorithm 267 1.3.5 Harmonic numbers 65 2.3.2 Towers of hanoi 270 1.3.6 Newton's method 2.3.3 Gray code 1.3.7 Converting to binary 68 2.3.4 Recursive graphics 277 1. 3. 8 Gamblers ruin simulation 71 2.3.5 Brownian bridge 279 1.3.9 Factoring integers 2.3.6 Longest common subsequence 287 Arrays Case Study: Percolation 1.4.1 Sampling without replacement..98 2.4.1 Percolation scaffolding 1.4.2 Coupon collector simulation 102 2.4.2 Vertical percolation detection.. 306 1.4.3 Sieve of eratosthenes 104 2.4.3 Visualization client 309 1.4.4 Self-avoiding random walks 113 2.4.4 Percolation probability estimate 311 Input and output 2.4.5 Percolation detection 313 1.5.1 Generating a random sequence 128 2.4.6 Adaptive plot client 316 1.5.2 Interactive user input 136 1.5.3 Averaging a stream of numbers 138 1.5.4 A simple filter 140 1.5.5 Standard input-to-drawing filter 147 1.5.6 Bouncing ball 153 1.5.7 Digital signal processing.... 158 Case Study: Random Web Surfer 1.6.2 Simulating a random surfer atrix 173 1.6.1 Computing the transition m 17 1.6.3 Mixing a markov chain ... 182 Object-Oriented Programming Algorithms and Data Structures Using Data Types Performance 3.1.1 Identifying a potential gene 337 4.1.1 3-sum problem 497 3. 1.2 Albers squares ..342 4.1.2 Validating a doubling hypothesis 499 3.1.3 Luminance library 345 Sorting and searching 3.1.4 Converting color to grayscale.. 348 4.2.1 Binary search(20 questions).. 534 3.1.5 Image scaling 350 4.2.2 Bisection search 537 3.1.6 Fade effect 352 4.2.3 Binary search(sorted array).. 539 3.1.7 Concatenating files .356 4.2.4 Insertion sort 547 3. 1.8 Screen scraping for stock quotes 359 4.2.5 Doubling test for insertion sort 549 3.1.9 Splitting a file 360 4.2.6 Mergesort Creating Data Types 4.2.7 Frequency counts 557 3.2. 1 Charged particle 387 Stacks and Queues 3.2.2 Stopwatch 391 4.3.1 Stack of strings(array)..... 570 3. 2.3 Histogram 393 4.3.2 Stack of strings (linked list)... 575 3. 2. 4 Turtle graphics 396 4.3.3 Stack of strings(resizing array) 579 3.2.5 Spira mirabil 399 4.3.4 Generic stack 584 3.2.6 Complex number .405 4.3.5 Expression evaluation 588 3.2.7 Mandelbrot set 409 4.3.6 Generic FIFo queue (linked list) 594 3.2.8 Stock account 413 4.3.7 M/M/l queue simulation 599 Designing Data Types 4.3.8 Load balancing simulation 607 3.3.1 Complex number(alternate).. 434 Symbol table es 3.3.2 Counter 437 4.4.1 Dictionary lookup 631 3.3.3 Spatial vectors 4.4.2 Indexing 633 3.3.4 Document sketch 461 4.4.3 Hash table 638 3.3.5 Similarity detection 463 4.4.4 Binary search tree 646 Case Study: N-Body Simulation 4.4.5 Dedup filter 653 3.4.1 Gravitational bod ...482 Case Study: Small-World phenomenon 3.4.2 N-body simulation 485 4.5.1 Graph data type 677 4.5.2 USing a graph to invert an index 81 4.5.3 Shortest-paths client 685 4.5.4 Shortest-paths implementation 691 4.5.5 Small-world test 696 4.5.6 Performer-performer graph.. 698 【实例截图】
【核心代码】
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论