You are on page 1of 16

SOIVI PUTER SCI ENCE

Introduction to Computer Science

PEARSON CUSTOM

csct 127

Pearson Learn ing Solutions
New York Boston San Francisco London Toronto Sydney Tokyo Singapore Madrid Mexico City Munich Paris Cape Town Hong Kong Montreal

['earson Learning So]utions. Suite 900. a() t I I Attention Btrtrkstores: For permissit)n t() return anv unsold stock.Senior Vice President. Please visit trur tveb site at it)r{'i{. Printecl in the United States of America. Editotial and Marketing: Patrick F. "Beech Forest.er Copyright O 2011 bv Pearson Learning Solutions All riehts resen'ed.llr'tt rsL) tl c t t s to n t. electronic ()r mechanical./Andrev Prokhorov.rt.L'()nr. ils:ust()ntrcttu'ns'<!p(Ltrs()n.pearsoned. Boles Executiae Marketing Manager: Nathan Wilbur Senior Acquisition Editor: Debbie Coniglicr D ea e I o p ment E dit o r : Annette Fantasia E dito i al As sist ant : J eanne Ma rtin Operations Manager: Eric M." courtesy of iSkrckphoto/Fkrrea Marius Catalin. "Netrvork. Coz. Kenney Prcduction Manager: Jennifer Berry Art Director: Ren6e Sartell Coaer Designer: Kristen Kiley Art: "Blend. Permission in rvriting must be obtained from the publisher before anv part of this work may be reproduced or transmitted in anv form or by any means. "Small Plant." courtesv of iSkrckphoto.r. or by any information storage or retrieval svstem." courtesy of iSkrckphoto/Andrev Solovyev. \4A 02116 A Pearson Education Company !v rv\l''. "Binary Data Flcxving. 501 Boylskrn Street." courtesy of iStockphoto. Boston.com lSBN 10:1'256-18594-9 ISBN 1 3: 978-1-256-18594-9 . including photticopying and recording.. contact us." courtesy of Getty Images/Jason Reed.

t'lyCodet'1ote ffiffi MyCodeMate is a book-specific Web resource that provides tutorial help and evaluation of student programs.com. Note: You may want to bookmark the appropriate page.mycodemate. the chapter references in these data files may not rnatch up with the chapter order in your book. as it contains links to additional products that you may be using in class. We recommend saving the files to your desktop to frnd them easily. 2. etc./cs_custom Before completing a project. If you do not have an access card. Check with your instructor for the best way to download these files. on the appropriate title of your Computer Science text. When you find the frle that you need. in the Peorson From an open Web browser go to: http://www. Click 3. your book may reference specific programs available through the www.com website. When these resources are mentioned in a chapter. or you may save the file to a specific location on you hard drive. In addition to Student Data Files. designed to aid you.pearsonhighered.com/cs_custom. will find all of the data Because you have a Custom book. If your professor ordered an access card to accompany your book. These materials are available to you via the following website. Any resources not fbund on http://www. 4. . please refer back to these instructions to access and download the coffect content.Importont Informotion Regordlng Supplementol Moteriols for Your Book Your custom book comes with additional student resources.conVcs_custom can be found at www. it is sometimes necessary to download and open data files.con-/cs_custom and www.com. The additional student resources through http://rvww. including source code.pearsonhighered. Downlooding Procedures for the Stuclent Doto FiIes Custom Publishing Progrqm 1n Computer Science l. or use the following instructions.com are provided to assist you in learning and practicing the concepts covered in your Custorn book. you have access to the materials available through MyCodeMate. These files provide the starting point for the project and the data with which to work.pearsonhighered.com. development environments.mycodemate.mycodemate. This can be solved by browsing through the posted folders and rnatching the file name to the appropriate topic covered in your book.pearsonhi ghered. you may open it to view the file immediately. searchable bv author last name and title: http ://www.mycodemate. This is where you files to complete the projects. you can purchase a subscription online at www.

.

GlennBrooksheor .379 ..shcur Brookshear 3 4 5 Oata Manipulation 79 J..4 Networking and the Internet J...20j 257 7 ...sheor Brook.1...sheur J. Programming Languages Glettn Brookshear 8 J.GlcnnBrooksheur 6 Algorithms ..323 ..371 . Glenn Brookshear J.J.GlennBrookshear J.GlennBrook.GlennBrookshear 12 Appendix: High-Level Programming Languages ..GlennBrcok..shear 10 nppendix: circuits to Manipulate Two's complement Representations J..377 11 Appendix: A Simple Machine Language J.381 383 13 Rppendix: The Equivalence of Iterative and Recursive Structures 14 Introduction Tonv Gaddis to Computers and Programming . Glenn iig 1 E. Glenn Rrtificial Intelligence Brookshear 319 $ Appendix: ASCII J.J...shear Data Storage I ig 2 ... Glenn Brcok.. Glenn Introduction Brook. Glenn Operating Systems J.Contents 1 .

.7Bs 863 20 TonyGaddis Index ..629 Tbry..15 Introduction to C++ Tont-Gaddis Tont...Gaddis 19 Functions Arrays ....Gaddis TonvGaddis TonyGaddis . S4S 17 Making Decisions Loops and Files 18 ..705 ....475 .....413 16 Expressions and Interactivity ...

. Glenn Brookshear. develop a historicalperspective.Introduction In this chapter we consider the scope of computer science.el r'ieu. Copvrieht @'2012 bv Pearson Ldr-tcation. . Pubhshcd bv pearson Aclclison-\Vesler.enth Edition. and establish a foundation from which to launch our study. Eler. 1 ? of The Role of A{gorithms The Histsrv {ornputing science of .. lnc. All rights reserved.{tgorithms 4 Abstraction The 3 5 An outline of our Study 6 sscial Repercussicns From Chapte r 0 of ContptLter Scietice: Ai1 OL. J.

ashcr. -fhe goal \\. compurer programs are usually printerl on pape r or displaycd on colxputer screens.g a prr)qrJnt. one of the berst knor.'s colnpLlters. and prospects fbr the future. in contrast to the n.oding it in machine<. fbu vides the underpinnings for today's computer applications as well as the Computer science is the discipline that seeks to build a scientific foundation for such topics as computer design. It pro_ 1 The Rote of Algorithms wc begin with the most fundamental concept of computer scjence-that of an algorithm. Once an algorithm for pcrformine a task has bee n fcrnnd. programs arc encoded ln a manner corrpatible r. we \4/ant to appreciate the ful1 sctpe and dynamics of the field.) In a sense.vhich is knotvn as hardware.s licl . are collcctiveil' refi:rred to as software.I ntroduction ndations for tomorrolr''s com puting in frastructure. ftrr (usr-ra1lr.e-one that u'ill support those who rn'ish to pursue more specialized studies in the science as u'ell as one that u'ill enable thosi: in other fields to flourish in an increasingly technical sctciety.r' a1l problerns of a partit. A representation of an algorithm is called a program. fbr playing rnusic (expressecl in the displayr:d on the insicle of the n. the performance of the task is recluced to the process of merel\' fbllorving dir"ections. Thus. the current state of research. proerams. The studv of algorithms began as a snb. operating rvashing machines finding the quotient of tu'o multiple-digit numbers. discovered bv the ancient (ireek nlathenlatician lruclicl. we will investigate a wide range of topics includlng most of those that constitute a typi_ ca1 university computer science curriculum. for finding your \l/ay through a srranse city lmore r.lidt:an algorithm.rr. Our goal is to establish a functional understanding of computer scienr.u1ar type could be scllved. and thc algorithn-rs tht:y reprcsetnt. fbrm of sheet music).s. This text provides a comprehensive introduction to this science.ompatible form. Inclecd. computer programming.r'n exanples of this edrlr. Ior the convenienr:e of humans.1. r. ln addition to the topics themselves.ch is the long division algorithrn fbr or perhaps on the lr'all of a laundromat). algorithmic solutlons of problems.as to finc1 a single set of'clirections that described hor. and ir-rst:rting it into a machine is callcd programming.r 1ss6'2. the pe rfbrmance <tf that task no longer requiles an nnderstanding of the prir-rciples on r. '1-hc process of developin. Betore a machine such as a computer can perfbrrn a task. Infbrmally. informauon processing. For example.rachine rV itself. there are algorithms for cooking (ca11eri recipes).r'hr. Ful the convenience of machines. Another example is the Eur.r'hich the algt)rithm is based. the algorithm u'orks. fbr finding the greatest co1r1r11on divisor of ilr'o positivr: integers (F igure 2). an algorithm fbr performing that task must be discovered ancl reprt:sentecl in a form that is contpatible n'ith the machine. an algorithm is a set of steps thar clefrnes how a task is performed. n'e will Le interested in their historical development. thg search fbl algorithms was a slgnificant activlt\/ of'mathematicians long be fore the dr:velopment of'toclar. the intelligence required to solve the problem at hand is encocled ir-r the algorithrr.ject in mathcrnatir. (\4Ie can foliorv the long division algorithm to find a cluotient or the Euclidean algoritl-n'n to frnd a greatest comnton divisor without understandlng r.r'ith thet technology of the machine.ommonly called directilnsl. and the algorithmic process itseli. Instead. ct. and fbr perfbrn-rinu magic tricks (Figure 1.

Ask the audience to request either a red or a black card. 3. pull back on each end ofthe deck so that each card is given a slightly backwardcurve. select ten red cards and ten black cards. Assign M and N the value of the larger and smaller of the two input values. state that there are no more cards of the requested color and turn over the remaining cards to prove your claim. the greatest common divisor is the value currently assigned to N. "And here are the black cards in this stack.I ntroduction Figure 1 An algorithm for a magic trick Effect: The performer places some cards from a normal deck of playing cards face down on a table and mixes them thoroughly while spreading them out on the table.. . repeatedlv execute the following steps: 6. Step 2. Then return these cards to the table in a face-down deck as you say... as the audience requests either red or black cards.1. In a manner similar to that in step 3. lf the color requested is red and there is a face-down card with a concave appearance. and callthe remainder step 3. with the thumb and first finger of your right hand. R. Divide M by N. 6..2. . J . Explain that you are thoroughy mixing the cards. lf R is not 0. Then 2. Pick up the red cards. 5. use both hands to mrx the red and black cards (still face down) as you spread them out on the tabletop. placethedeckof redcardsfacedownonthetableasyousav. " Step lmmediately after returning the black cards to the table. assign N the value of R. and return to step otherwise. Secret and Patter: Step Step Step 1 .Here is a red card. respectively. then assign M the value of N. 6.3.4. Deal these cards face up in two piles on the table according to color." Step 4. Under the pretense of aligning them into a small deck. 6. Announce that you have selected some red cards and some black cards. As long as there are face-down cards on the table. turn over such a card while saying. lf the color requested is black and there is a face-down card with a convex appearance." 6. the performer turns over cards ofthe requested color. Step Figure 2 The Euclidean atgorithm for finding the greatest common divisor of two positive integers Description: This algorithm assumes that its input consists of two positive inregers ano proceeds to compute the greatest common divisor of these two values. From a normal deck of cards.Here is a black card. Otherwise. Then. 2. Pick up the black cards. "Herearetheredcards in this stack. Procedure: Step '1. hold them face down in your left hand and. turn over such a card while saying. give these cards a slight forward curve.

One of the earlicr cemputin. and the stucly of algo_ rithmic capabilities that ensuecl rr.hine. In a sin-rllar manr-]e1.hose truth or falseness cannot be establisheci b5.as the beginning of the fleicl known-t1-1c1ay'as computer scienr. In turn. Among these r. Indeed. in these machinr:s. output fr^om pascal's and Leibniz's machines was achieved bv observing the final gear positions. the machine reliers on the hur-n:rn operator. consequentry. and (. on the other hand. to follou.ore of computer science. the appropriate sequence ot steps r. states that in any mathematical theory encompassing our traditional arithmetic system.hins is cluite simple.r papcr so that the possibility of transcription errors r. it nrLrst bc cornblnetcl r.1 716) of (ierm.es n'as the abacus. In the tlme period atter the Nliddle Agcs ancl betfore the Mocleln Era thc clucst fbr more sophisticated computinq mar. we can construct a machine to perform a task only if an algorithm exists for performing that task.1'rarlcs lSabbage Q79'2-187r) of Er-rslancl 'lhesc machines representecl data through ge ar positioning.hines u'as seeded. For control of'an algorithm's execution. u'ith data beins input mechanically by establishing initial gear positions.l complete computational ntar. Babbage. As the bcacls are movccl back and firrth 9n the rtlds. Babbage.v a data storatgtt s\rstelr. it is the studv of'algorithms that firrms the r. inventors began lo expcrimt:nt n'ith tl-tc technolog]. Thus the abacus algr-rt: is I1lclrol.hich on1\' s demonstration model \\'as constructecl) could be modified to perform a variety of calculatictns.tical Er-rgine (the construction for lr4tich he 'Irlday's computers have an extcnsivt: gi:nealogv.rny.r'ance. Consequently.onsisting of beads strung on rocls that are in turn mclunted in a .Introduction It is through this ability to capture and convey intellige nce (or at least intelligent behavior) by means of algorithms that rve are able to build machines that perform useful tasks. I Iistory tells us that it most likely hacl its roots in ancienr China and was used in the early Cireek ancl Roman civilizations. then the solution of that problem lies be'onc1 the capabilities of -u"hirr"r. the leve1 of intelligence displayed by machines is limited by the intelligence that can be conveyedlhrough algorithms.l prirtt resr-rlts clf computatjcrns or. of gears. \\/e can see a progression of f1exibi1it1. anv complete study of our arithmetic svstem lies beyond the capabilitie s of algorithmic activities. Leibniz's mar:hine haci its algorlthms firmly embedded ir-r its architecture. their positions represent storecl values. algorithmic means. In short. an algorithm.1 6{i2) ot I.r'as embeclded into the structure of the machine itselt-. there are statements u. This realization shook the foundations of mathematics. (}ottfried \\rilhelm Leibniz (r 646. 2 The Historyof Computing roctancular frame (l igure 3).q devir.rem essentiallr.r. if no algorithm exists for solving a problem. 'l'he mar. envisioned machines that u'oulr.e. It is in thet positions 9f the bgacls that this "conlputer" reprosents:tncl stores clata. Identifying the limitations of algorithmic capabilities solidified as a subject in mathematics in the lg3Os u'ith the publlcation of Kurt G6del's incompleteness theorem. A f-eu.vould be elininated. r. Pascal's macl'rine u'as built to perform only acldition.ere Blaisc pascal ( 1623. This thr:. As for the abi1it5. but his Analt. althor-rgh it offered a variety of arithmetic operations from rt'hich the operator could select.s DifTerence Engine (of u.r'ith a human to create .

the voting issues raised in the 2000 tJ. is often identificd toda\r as thc rrorlcl's flrst pr-9grarir-16r. arr llg.r'itnesseci b)..n as punchecl carcls ancl survived as a popular means of conmunicaring rvith cornputers u. who. rr.r'ere determined bv patterns of hole s in large thick cards macle of r'r'oocl (or carrlboarcl. cetnsus. thc technique lives on todav.r fi'om Joseph Jacqr-rard (\75'2-ItJ-t4).rs not orr!. tl-rc algorithm follou.S. Leibniz. had developed a r. in papt:r cards to specd gp the tabulation .p. Augusta Ada Byron (Ada Lovelace).ecl by the loom could be changed easily to procluce differe nt \\/oven clesigns.) Such cards ultirnately carne to be knorr.r. But lvith the advances in electronics in the early 1900s. as r. completecl in lg44 process in the 1890 li. Another be ne ficiary of Jacquard's idea rvas IIt:rman Hollcrith (1gtiO-1929). in 1801 . rvho publishecl a paper in u. The technology of the time tvas unable to prodnce the corlplex gear-clriven nachines of Pascai. 'fhus Babbager's Analvtical I-ngine \\/as prosralln. lhc idc.r'eaving loom in n'hich the steps to bc pcrfbrmed cluring the r'veaving process r. In fact.ras overcome.ho applied the concept 9f paper crards.r ol con)ntunicatin!. computations.S.inated by Babbage. presidential electiolt.orkbv Hollerith that lecl to thc creatiorl of iBM.rblt:. In this rnanner.ell lnto the 1970s....r holr:s'i rr p.I ntroduction Figure 3 An abacus (photography by Wayne Chandter) "An abacus ". He got the idt:.lark I. flt was this.tions in the f9r1r of holes in representing infbrmation as holt:s Indeed. ancl rire N. Examples of this progress include the electr"omechanical machine of George Stibitz.r iLltrrr vi. completed in 1940 at Bel1 Lallorarories. O Wavne Chandler. this barrier \.hich she demonstrated hor'r' L3abbagc's Analytical l-nginc could br: programnreci to pcrflrln varir-rus never received funding) n'as designed to read instrur..1 rr. and Babbage in a flnanciallv feasible manner.

ernment had been on thC scate of today's requirements. and 5 3 = 2.:il-. ences is beyond the scope of our current study. As it was. only a demonstratlon model :i. is a stralght line with a slope of 2.as apparentlSr 11-r" Atanasoffl Berry machine.) -02 = 1. we first compute tire differ. Another u'as a machlne called Colossus.ff i:f of his Difference Engine was constructed in his iifetime. Note that these differences are both 2. (Althoustr a more in-depth discussion of successive differ. students of calculus may wish to observe that the preceding example is based on the fact that the derivative of y . constructed durins the perlod fl'om 1937 to 1941 at lo$'a state College (nou' Ion'a State I-Iniversitr') b1. and the squarc of 3 is 9. Clif1brd Berry. This machine deterrnined" numerical values by computing. and 42. because other researchers rvere apph'ing the technokrgr.fr?$Ttr$":lr$:h:r'H1-.22 . controlled mechanical ri:1ays.. The flrst of'these machines u. In .Tffi . we can determine the souare of 4 in the following manner (see the foflowing diagram).!2:3. we could continue our procedure to compute the square of 5 based on the values of 12. the square or r ii rltne square of 2 is 4. Ilon.so 42 j2 = z and thus 42 = 32 + 7 = l6. with this.22.\tanasoff and his assistant. These machines made heavv use of electlonicalh.successlw differences. encesof thesguareswealre'adyknow:12 Then we compute the differenc€s ofthese results: 3 1 = 2. - - - - * - - : 0 7 0 1 2 3 4 9 4 5 ffi +-- "ffi -ffi -ffi this sense thev n'ere obsolete alnost as soon as thr:y u'ere built.be 2.ar-d r\iken and a group of IBM r:ngineers (figure 4)." We can gain an insicht to this technique by considednfthe problem of computing the squares of the intJce. Hence (42 3\ rnust be 2 greater than (32 2).3t.and32 _22 = 5. built under the clirecticln of Tommrr at llarvar:d LJniversitv br.Nowthatwe know the square of 4. Assuming that this consistency continues (mathematics can show that it does) we conclude that the difference between the value {4' i? and the value g^2 22} must also.. John . we begin with the knowledge that the square of 0 is 0... of vacuum tubes to construct totally electronic computers. Babbage's ia"as couta tiaue Ied to a computer revolution in the 1go0s.'#il:ir':ffiffi:'.Introduction Difference Engine nomically basible manner ana lrtte oata processing dernands of commerce and ssv.

also won a Nobel Plrizr: rn physics). as many as ten of these machines \^/ere apparently built.ere rcduct:d ovcr the der.h as the ENIAC (elcctronic numerical intcgrator ancl cak.r.lohn Mauc.' kept their existence from becoming part of the "computer fami11.1. ancl Radicr Shack. . with thesc devclopmenrs.etd.Introduction Figure 4 The Mark I computer (courtesy of rBM archives. unauthorized use is nor permitted. thsy lilrlu'ers in England to decodc (ierman messagcs cluring rhe lattcr part of World war II. other compa. (norv Apple Inc.ades to thc size of singlc r_abine ts. nles that nlarketed similar products u'ere Comn-Ioclore..ennsyivania.ien wozniak built a conrmercially viable home computer and. At the samt: timt:.hich pht. in 1g76. Unauthorized use is not oermitted. Inc. The origins of these machines can be tracecl to the computer hobbyists u'ho built homemade computers from combinations of chips. but milItary se(lrecy and issues of national securitr. A rrrajor step to\^iard popularizing colnpltting rvas the developrnent of desktop computers. the room-sizt:d machlncs of the I940s u. Heathkit.arclecl a Nobel l']rize) and the subsi:quent cle velopme nt of complete circuits constructe cl as singie units.ulator) dt:veloped b5. As u'ork on integratecl circuitry progresst:ci. sur. thc procr:ssine power of computing machincs began to clouble every two ycars (a trend that has continued to this day). ntorc flexiblc ntachincs. (Actually. establishecl Apple computer. called chips. John l3arcleen.) "The Mark I computer. Although these products \\rere populal amons conlpurer hobbvisls.hich . of cotrputing rnachines has bt:en closely linktld to advantllng tcchnolosv.re Nloorr: School of Elt:ctrical Enginecring.Iack Ki1b1.as within this "underground" of hobby activitv that Steve Jobs and Stepl. includir-rg the ir-rvr:ntion of'transistrlrs (for lr.proclucts.sicists William Shclcklel'. Prespcr Eckrtrt at tl." Courtesy of IBM corporate archives.hlv and . trec. It n. manv of thg circuits rvitirin it colltputer became reaclily available on the open market as integrated circuits encased in to\.-sizecl blocks of plastic .') Othr:r.cre an. ca1led integrated circuits (for n. sor_rr-t fit]ktn. the history.) to manufactnre ancl market their. IInivcrsity of l. lrom that point on. and \Aralter Brattain r.

'Ihese companies contitrue to expanci their \4reb-related activities..Introduction .[iffi $STl"S$"i{!:. most of lvhir. calkrcl thi: personal compute r. Augusta Ada Byron is recognized today as the worldt first programmer.omt-nunity." \^/cre not n'idelt' acceptcci b]' the busiltess r.' is n. Nonetheless.h continue to be marketed with sclftr.as desktop clomputer as an establishecl comr-noclitv in the mincls of'the business community 'lodat.sift through.. a status that was certified by the u. Deoartm. some arsue that Babbage made major contributions whereas others contend that he was mire of an obstacle than an aid.::r':Tffi':r#'.iin rnath€rnaUii. or PC. The degree to which Babbage influenced Ada Byronb work is debated by historians.lBM introdr-rr. lvhich continuecl to look to the r'r'e1l-esmblished IBN{ fbr the majoritv of its computing neecls. and ther-r use the resuits to assist users researching particular ropics. The PCI rr.idely used to refi:r to all those machines (from various tnanufacture lsl n'1. (As the daughter of Lord Bvron.r'as revolutionizing curnnlunicatiot-l.' (1815-1852) that was mmpticated by poor health and ttre iact tt ai str* uftls a non4 conformist in a society that timited ihe professionat role of women. thc term P(. Babbage encouraged her to aitach an addenJum oeiciiring applications of the engine and containing examples of how the engine coula be programmed to perform various tasks. and Microsoft.s initial cleskgeneric terms deskrqt or laptop.rosc clesign has evolr.. Ada Byron held celebrity status with potentially significant financial connections. ffi ffi :^. "categorize" their t-indines.c is useci interchangeably with thc .a\. the term 1. called search engines.ecl fiom IllM. the \A/eb. At times.ed lts first desktop corxputer.inaieo bv ttue machines of charles Babbage at a demonstration of a prototype of tris nir*r*n. Major plavers in this fjeld are Google.: ftom French into Engtish of a paper discussing Babbage's desiens for the Anatwieal Engine. she concentrated her studi. Her interest in "compute scienceo began when the becarne iis.are from Microsoft."'.. horvever. u'ere developed to .s. ntthoush stt* inter€sted in a wide range of science.j This backing never materialized. n'hose undi:rlyine sofru'arc u'as dcvelopecl by a newly fbrmed r.:r *"r t En$ne in 1833. Her contribution to computer science stems frorn trer transtaff. Iim Berners-Lee (a Britisl-r scientist) proposecl a systenl by r'vhich documents stored o1-] compurels throughout the lnternet could be linked together producing a nlaze of linked information callecl the World Wide web (often shortened to "web"). alr instaltt succcss ancl legitimized the top computer.. Tb make thc information on the web accessible.r'are svstems. the ability to connect indiviclual computers in a worlcl-n'ide svste m ca1led the Internet r. As the tr't'entieth centur\r dre\\' to a clctse. but Ada Byront addendum has survived and is considered to contain the first examples of computer programs. To this translation.om- pany kno$'n as Microsoft. yahoo. In this context. softr.r. Babbage's enthusiasm for Ada Byront work was apparently motivated by his hope that its publication would lead io financial backing for the construction of his Analytical Engine. In l98l. of thinking. often in clirections that challenge our traditional rr.nt oi Defense when it named a prominent programming language (Ada) in heihonor.

rnoniroling rhe function of the engine. manv argue that the smartphone u'ill have a qrc:rtcrr effect on societv thar-r the I)(1. and a host of other Internet services (including Google Maps. and providing voice command serwices for controlling the car's audlo and phone communication systems. Today tinl' computers are embedded within various devices. In addition. Perhaps the most potentiallv revolutionary application of computer miniaturization is found in the expanding capabilities of portable telephones. However. Google! search engine has led to questions regarding the extent to which an international company should comply with the wishes of individual governments.r'n right. accelerometers (to detect the phone's orientation and mclticln). Moreover. Clobal Positioning Systerns 1CPS1. compasses. Indeed. what n'as recentiy merely a telephone has evolved into a small hand-held generalpurpose computer knon'n as a smartphone on u'hich telephony is only clne of many applications. Google also provides examples of how expanding technology is challenging society.Google Earth. storase. 'I'he potential is enormous. -I'hese "phones" are equipped lvith a rich arra1. and applications. Google Calendar.s. Google Books has generated concerns regarding the scope and limitations of inlelectu. Computing ter.it:nce. t:acl-r of lvhich is now a significant fleld of study in its or. has become one of the worldb most recoginzed techology companies. an Internet based video sharing service (catled YouTube). Google Inc. of scnsors and interfaces includins cameras.hnologv has altered the ability of governments to exert <. (. and Google Translate). means fbr people to communicate and interact. in addition to being a prime example of the entrepreneuriat spirit. touch screens. as rvith mech:rnical engit-iet:ritrg and ph5rsi6s. led tcr startling advances in sr. Google Books. contain smal1 computers runnine. YouTube has raised questions regarding the extent to which a company should be tiabte for information that others distribute through its services as well as the degree to which the company can claim ownership of that information. automobiles no\. For example. and Google Maps has been accused of violating privacy rights.had enormous impact on global economir. lts core seruice.r'een rhose fjelds and Google Founded in 1998.a! property rights.I ntroduction At the same time that desktop computers (and the ne\\/er mobile laptop computers) were being accepted and used in homes.rmputer tcchnttlogy is so prevalent no\l' that tamiliaritv u'iti-r it is fundamental to being a membcr of modt:rn society. For example. Google provides electronic mail service (calted Gmail). Indeed. the miniaturization of computing machines continued. is used by millions of people to find documents on the World Wide Web.'s societv. 'l'he result is a prcllif'eration of subjects surxrunding conlputer sc. provided ne\\. r'evolutionized the role of data collection. .\. 'l'he rniniaturization of computers and their expanding capabilities have brought computer technitlclgv to the forefiont of todar. and a number of u'ireless tcchnologies to communicate n'ith other smartphones and computers.. and has repeatedlv challengecl societv's status quo. it js often djfllcult to dral' a line be6.ientifrr: research.ontrol. the Google search engine.t. microphones.

psycho1og1. business adrninistration.rs be made easier? How can the technlques of representir-rg and communicating algorithms be improved. to gain a proper perspective.ddel's incompleteness thcprem. as these limitations began to disappear. thc: current topics of rese arch. it is eas5r to losr: track of the overall picture.gramming process. a researcher in the freld of database systems ma\r see conrputor scie nce as sceking u. engineering. of topics. It \'\'as in this context that the theclrt:tical n'ork of mathematicians began to pay dividencls. Hon'ever.. With such a varietl. an introduction to computer science is an interclisciolinarv u nde rra kins 3 The Science of Algorithms 'loday.Introduction computer science ltself.qorithmic procoss€ls that advancing technolosy \\/as nou. (tomputer sciencc as thet advancement and application of'ter.s. Indet:cl.' IIou' can the characteristics of diflerr. ii researchcr in the field of computer architectllre mav fircus ot-t the task of miniaturizing circuitrv and thus vicu. and some of tl-re techniques being appliecl to aclvance knon'le dge in the area.omputer sr.. the stage was set fbr the emergenr-e of a nerv cliscipline knou. 'l-he scope of this science is broad. 10 . As :l consecllrence of (. an intrttduction to conlputer scienct: nrust inclr-rde a varicty o1'topir. more ancl more research efforts were directed ton'ard the study of algorithms and the pr. r r r r Which problems can be solved by algorithmic processes? FIon' can the cliscoverv of algorithn.lqnrithms hc "naTyzed and compared? .hnology. our goal u'ill bc to introduce the ce ntral idcas in thc subject. l-or cxantplt:.'\nd.. Indeed. 'lhus. As attempts to exprcss the composjtion of thesr: tasks in algorithmic form began to tax the abilities of the human mlnd.ience may have vcry distinct clefiniticlns rlf the science. our study will not only cover topics central to the core of computer science but will also explore a variety of disciplines dealing r. machines tvere applied to increasingly larger ancl more complex tasks.n as cotllpLtter scienrr. drarving fi"om such diverse subjects as mathematics. and linguistics. rnathematicians had alreadv been investigating thosc questions regarcling al. biology.nt . Conditions such as limited data storage capabilities and intricate. Thus.ays to make informatioll systems more useful. with that. l3ut.r'ith both applications and consequences of the science. a researcher in the field of'artiflcial intclligcnr:e may relgard (lompllter sr:icnct: as the studv of intellieetnce ancl intellieent behavirtr. How can aleorithms be used to manipulate information? r Ilolr' can algorithms be applied to produce intelligent behavior? r llou'does the application of algotithn-rs affect society? Note that the theme conlmon to all these questions is the study ot'algorithms (Figure 5). we therefbre pause to collect orlr thoughts by identifying somc questions that provide a focus for its studv. time-consuming programming procedures restricted the complexity of the algorithms utilizecl in earlv computing machines. In each case. raising. researchcrs in differcnt branches of r. compute r science has established itself as the science of algorithms.