Computer Science
Algorithms in Computer Science
Algorithms in computer science are step-by-step procedures or formulas for solving problems. They are a fundamental part of computer science and are used to perform various tasks, such as searching, sorting, and data analysis. Efficient algorithms are crucial for optimizing the performance of computer systems and applications.
Written by Perlego with AI-assistance
Related key terms
1 of 5
10 Key excerpts on "Algorithms in Computer Science"
- eBook - PDF
- Rex Porbasas Flejoles(Author)
- 2019(Publication Date)
- Arcler Press(Publisher)
FUNDAMENTALS OF ALGORITHMS CHAPTER 1 CONTENTS 1.1. Introduction ........................................................................................ 2 1.2. Different Types of Problems Solved by Algorithms ............................... 4 1.3. Data Structures ................................................................................... 8 1.4. Algorithms as a Technology ................................................................. 9 1.5. Algorithms and Other Technologies .................................................. 11 1.6. Getting Started With Algorithm ......................................................... 13 1.7. Analyzing Algorithms ........................................................................ 18 References ............................................................................................... 25 Introduction To Algorithms 2 1.1. INTRODUCTION We define an algorithm as any well-defined computational method that takes input in the form of any value, or else set of values, and resultantly produces any value, or else set of values, as output. Hence, an algorithm is considered a sequence of computational steps which transforms any input into the output. Another way of seeing algorithm is to consider it as a tool that solves a well-specified computational problem (Aggarwal & Vitter, 1988; Agrawal et al., 2004). Generally, the statement of the problem postulates the desired relationship between input and output; whereas, the algorithm defines a particular computational process for achieving that relationship between input and output. For instance, suppose that we want to sort a sequence of numbers into an increasing order. This problem arises quite often in practice and makes available a fertile ground for presenting numerous standard design practices as well as analysis tools (Adel’son-Vel’skii & Landis, 1962; Abramowitz & Stegun, 1965). - David Riley, Kenny A. Hunt(Authors)
- 2014(Publication Date)
- Chapman and Hall/CRC(Publisher)
130 ◾ Computational Thinking for the Modern Problem Solver actions, and how to reduce complexity by decomposing large problems into smaller units. 5.1 ALGORITHMS An algorithm is a sequence of discrete actions that when followed, will result in achieving some goal or solving some problem. Everyone is accus-tomed to following algorithms in daily life whether we are aware of it or not. Football players are following an algorithm when they execute a play on the field; drivers are using an algorithm when they follow a set of instructions for getting from one city to another; piano players are using an algorithm when they read and play a musical score; mathematicians are using an algorithm when they use long division to find the ratio of two numbers; and actors are using an algorithm of sorts when they read and execute a script for some theatrical performance. As another example, consider that a recipe is an algorithm that a chef can follow to create a main dish, dessert, or even a drink. Chocolate Chip 1 Cookie Recipe Ingredients • 1 cup melted butter • 2 cups brown sugar • 2 eggs • 3 cups flour • 1 teaspoon baking powder • 1 teaspoon baking soda • 2 cups chocolate chips Directions 1. Preheat the oven to 375 degrees F. 2. Line a cookie sheet with parchment paper 3. In a bowl, stir together the butter, brown sugar and eggs. 4. In a separate bowl, combine the flour, baking powder and baking soda. Gradually combine with the sugar mixture. 5. Add the chocolate chips 6. Fill the cookie sheet with one-spoonful drops of the cookie dough. 7. Bake dough for 9 minutes 8. Cool for five minutes before removing from cookie sheet. Image courtesy of http://www.flickr.com/photos/amagill/34754258/ In the field of computer science, an algorithm is any well-defined sequence of actions that takes a set of values as input and produces some set of values as output. In other words, an algorithm is a sequence of com-putational actions that transform the input into the desired output. A- eBook - PDF
- Xingni Zhou, Qiguang Miao, Lei Feng(Authors)
- 2020(Publication Date)
- De Gruyter(Publisher)
2 Algorithms Main contents – Concept of algorithms – Representation of algorithms – Effectiveness of algorithms – Universality of algorithms – Comprehensiveness of algorithms Learning objectives – Know concepts related to algorithms – Know the characteristics of computer algorithms – Know representations of algorithms – Know general procedures of algorithm design – Can design algorithms in top-down stepwise refinement method Donald Ervin Knuth once said, “ Programs are like blue poems. ” If that is true, then algorithms are the soul of these poems. 2.1 Concept of algorithms 2.1.1 Algorithms in practice Let us take a look at a real-life algorithm: ticket purchasing at the ticket office. When there was no internet, Mr. Brown had to buy train tickets at ticket offices when he needed to take business trips. The main procedures of purchasing tickets are shown in Figure 2.1, in which the key information includes the date, destination, train number, price, and fare. In fact, everything is done under certain conditions and through performing a se-ries of operations. Algorithms are methods and procedures used to solve the problems. Nowadays, Mr. Brown can purchase tickets easily online. The main steps of online pur-chasing are shown in Figure 2.2. Compared with offline purchasing, online purchasing uses the same set of crucial information, except that we are dealing with computer sys-tems instead of a human. Step 1: The passenger provides information on trip date, destination, etc. Step 2: The staff finds trains available on that day Step 3: The passenger chooses a train and determines number of tickets to buy Step 4: The passenger pays the fare and collects tickets Algorithms are methods and procedures used to solve problems. Case Study 1 Purchasing tickets through ticket office Figure 2.1: Flow of purchasing tickets at the ticket office. https://doi.org/10.1515/9783110692327-002 - eBook - PDF
Elementary Synchronous Programming
in C++ and Java via algorithms
- Ali S. Janfada(Author)
- 2019(Publication Date)
- De Gruyter Oldenbourg(Publisher)
https://doi.org/10.1515/9783110616484-001 1 Basic concepts of Algorithm 1.1 Algorithm The word algorithm is derived from the name of a great Iranian Muslim mathemati-cian, astronomer, and philosopher named al-Khawrizmi 1 , who lived in the second century anno hegirae. In general, by an algorithm, a set of usually predefined and orderly instructions is meant to be followed to solve a particular type of problem. One may perform various kinds of algorithms without being aware of them, in their rou-tine and daily lives. For instance, the process of preparing a meal requires several instructions since different stages are needed in cooking and preparing it for serving. Take as another example, attending a church or mosque to say one’s praying. This ritual needs several processes which can be turned into an algorithm. The same ap-plies to robots. These machines are designed based on a special algorithm which in-cludes a set of instructions to implement them in a way that when such instructions are implemented successively, they move harmonically and perform the predesigned tasks accurately. Other instances could be constructing a building, driving a car, tak-ing medicine, setting the table, reading a book, taking a trip, publishing a book, di-recting an office, and many other types of activities. When a mathematical problem is suggested in a classroom, and the corresponding data are presented afterwards. Consequently, particular solutions are expected to be obtained. Accordingly, a prob-lem-solving algorithm is implemented 2 in order to arrive at specific results. Even the processes which follow in somebody’s mind during solving a problem in their per-sonal lives, some kinds of algorithms occur somewhat differently, for these algo-rithms are not predefined vividly. Having understood a problem, one could investigate various steps to approach the solution. That, in turn, requires several other phases to arrive at a certain finding to the posed problem. - eBook - PDF
- Roland Backhouse(Author)
- 2014(Publication Date)
- Wiley(Publisher)
The notion of an algorithm hardly needs any introduction in our modern computerised society. It is not that algorithms have only recently come into existence. On the contrary, algorithms have been used for millennia. Algorithms are used, for example, in building and in measurement: an algorithm is used when tunnelling through a mountain to ensure that the two ends meet in the middle, and cartographers use algorithms to determine the height of mountains without having to climb up them. But, before the computer age, it does not seem to have been considered important or relevant to emphasise the algorithm being used. 1.1 A L G O R I T H M S An algorithm is a well-defined procedure, consisting of a number of instructions that are executed in turn. In the past, algorithms were almost always executed by human beings, which may explain the earlier lack of emphasis on algorithms. After all, human beings are intelligent and cope well with imprecise or incomplete instructions. Nowadays, however, algorithms are being automated more and more often and so are typically executed by computers, 1 which can at best be described as ‘‘dumb’’ machines. As a consequence, the instructions need to be both precise and very detailed. This has led to major new challenges that tax our problem-solving ability and to major changes in what 1 Long ago a ‘‘computer’’ was understood to be a person, so we should really say ‘‘electronic digital computer’’. However, we now take it for granted that this is the sole meaning of the word ‘‘computer’’. 4 ALGORITHMIC PROBLEM SOLVING we understand as the solution to a problem. The computer age has revolutionised not just our way of life, but also our way of thinking. 1.2 A L G O R I T H M I C P R O B L E M S O LV I N G Human beings are quite good at executing algorithms. For example, children are taught at an early age how to execute long division in order to evaluate, say, 123456 divided by 78 and its remainder, and most soon become quite good at it. - eBook - PDF
- Sourabh Pal(Author)
- 2023(Publication Date)
- Arcler Press(Publisher)
A proper algorithm solves the stated computing issue. An erroneous algorithm, on either side, cannot halt at all on certain input examples, or it can halt with an inaccurate response (Ahuja et al., 1989; Courcoubetis et al., 1992). In contrast to our assumptions, erroneous algorithms may occasionally be advantageous if the rate of mistake may be Fundamentals of Algorithms 3 controlled. Therefore, we shall only be concerned with accurate algorithms (Figure 1.1) (Szymanski and Van Wyk, 1983; King, 1995; Didier, 2009). Figure 1.1. Algorithms’ basic structure and overview. Source: http://openclassroom.stanford.edu/MainFolder/CoursePage. php?course=IntroToAlgorithms. An algorithm may be written in English, in the format of a computer program, or even as a hardware design. The only criterion is that the problem definition must include a clear description of the computational procedure to be used (Snyder, 1984). The following are the features of an algorithm: • Each instruction should take an indefinite amount of time to complete; • Almost every instruction should be explicit and accurate, that is, each instruction must have just one meaning; • The consumer must get the expected outcomes after following the directions; • There must be no unlimited repeating of a single or several instructions, implying that the algorithm must eventually finish. 1.2. VARIOUS TYPES OF ISSUES SOLVED BY ALGORITHMS Scientists have devised algorithms for a variety of computer problems, including sorting. Algorithms have a broad range of practical usage across the world. The following are certain such instances: • The Human Genome Project are made tremendous progress in recent years toward the goal of classifying all 100,000 genes The Fundamentals of Algorithmic Processes 4 found in the DNA of humans, specifying the sequences of the 3 billion chemical base pairs that make up human DNA, storing this massive amount of information in databases, and developing data analysis techniques. - V V Voevodin(Author)
- 1992(Publication Date)
- World Scientific(Publisher)
More s p e c i f i c a l l y , we are interested i n studying computation-al processes. Let us consult the Mathematical Encyclopaedia -perhaps i t can o f f e r a more s t r i c t d e f i n i t i o n . The Mathematical Encyclopaedia defines an algorithm to be formal i n s t r u c t i o n s specifying the computational process that s t a r t s with ar-b i t r a r y input data and aims at achieving the result that corresponds to these data. Then i t proceeds to explain what formal instructions are, 4 and what the computational process i s , and so on. I t looks l i k e i t is f u t i l e to continue our search f o r a rigorous mathematical d e f i n i t i o n of algorithm. The notion of algorithm i n gener-al i s one of the primary notions that cannot be reduced to more basic concepts. Ue can only r a t i o n a l i z e or c l a r i f y i t , d e t a i l i t i n some way, write i t down using some notation, etc. While hope existed, that a l l mathematical problems can be solved algorithmically, there was no good reason to refine the concept of algorithm. Once a recipe was suggested to solve a problem or a class of problems, there was a t a c i t agreement that t h i s recipe was an algorithm. The necessity to r e f i n e the notion of algorithm only materialized when i t was proven that there exist pro-blems that cannot be solved using algorithms from a specified class. We s t a r t our elaboration of the concept of algorithm by enumerat-ing i t s features. Here is the l i s t provided by the Mathematical Encyc-lopaedia: -the set of possible input data; -the set of possible results; -the set of possible intermediate results; the rule to s t a r t the algorithm execution; the rule of processing; the rule to end the algorithm execution; -the rule to obtain the result. There are several commonly accepted refinements of the i n t u i t i v e concept of algori thm. We mention the Turing machine, recursive func-tions and normal algorithms.- eBook - PDF
Computing
A Historical and Technical Perspective
- Yoshihide Igarashi, Tom Altman, Mariko Funada, Barbara Kamiyama(Authors)
- 2014(Publication Date)
- Chapman and Hall/CRC(Publisher)
255 C H A P T E R 27 The Design of Computer Algorithms As described in Chapter 18, computers were traditionally built to calculate the solution to numerical problems such as the determination of the roots of an algebraic equation, or to process numerical data, e.g., the statistical calculation of national consensus data. However, for the last 40 years or more, a great deal of important work has also been done by computers for nonnumerical problems, such as sorting, searching, word or language processing, and solving combinatorial problems in software development, data communication, and the simulation of various biological, chemical, and physical processes. The design and analysis of computer algorithms have been developed in the context of such applications. 27.1 SORTING AND SEARCHING Sorting a sequence of numeric or alphanumeric items means rearrang-ing them in some specific order. Since a significant portion of data pro-cessing involves sorting, efficient sorting algorithms are of considerable importance for many practical problems [3, 7]. Sorting is one of the first problems for which algorithms were formally analyzed and evaluated. It is considered to be a fundamental problem in the area of algorithmics , mainly because sorting often plays an essential part of many algorithms. For example, sorting significantly facilitates a search for elements in some set or a list. A dictionary is a typical example of a sorted list. Words in a dictionary are usually arranged in an alphabetical order, which allows us to easily locate the word that we are trying to find in the dictionary. 256 ◾ Computing Some sorting methods were in use long before the invention of computers. For example, a card player sorts the cards of his hand so that each card is visible and individually accessible. Suppose that A , 2, 3, 4, 5, 6, 7, 8, 9, 10, J , Q , K are the order of the cards. The following method has been com-monly used among card players. - Fabrizio Luccio, Linda Pagli, Graham Steel(Authors)
- 2011(Publication Date)
- CRC Press(Publisher)
Chapter 4 The algorithm: the key concept How shameless Martin applies mathematical logic when courting girls, and how a police officer may be unable to identify a criminal gang in the Web. The algorithm 1 is the key concept of this book. When in the 1930s Alan Turing and other logicians came up with a sound definition of the algorithm, computer science took its first steps, although no computers had yet been invented. Algorithms accompanied the growth of this new science up to the Internet and through to the Web era where they lie at the foundation of everything. Based on the primitive concepts discussed in the previous chapters we will now illustrate several algorithms to be used later as building blocks, starting from the indispensable theoretical foundations of our discussion. Let us return to the world of sequences. Our analysis will not lose generality if we restrict this world to the binary case that interests us most. Call these sequences σ 0 , σ 1 , σ 2 , ... and arrange them in canonical order , i.e., by increasing length and, for the same length, by increasing value of the corresponding binary numbers, starting from the empty sequence . We have: σ 0 σ 1 σ 2 σ 3 σ 4 σ 5 σ 6 σ 7 σ 8 ... σ 14 σ 15 ... 0 1 00 01 10 11 000 001 ... 111 0000 ... (4 . 1) i.e., the binary sequences can be put in a one-to-one correspondence with the natural numbers 0, 1, 2, .... , or, in the terminology of set theory, such sequences are numerable . Adopting the numbering induced by the canonical order, for any given sequence σ i we can reconstruct in finite time its number i , and vice versa, no matter how long the sequence is. Keep in mind that we are talking of sequences of finite but unbounded length, that is, for any length l arbitrarily fixed there are (infinite) sequences longer than l . This infinite world of numerable objects has attracted thinkers since an-cient times.- eBook - PDF
- G.Michael Schneider, Judith Gersting(Authors)
- 2018(Publication Date)
- Cengage Learning EMEA(Publisher)
The Algorithmic Foundations of Computer Science 1 L E V E L Chapters 2, 3 Chapters 4, 5 Chapters 6, 7, 8 Chapters 9, 10, 11, 12 Chapters 13, 14, 15, 16 Chapter 17 The Algorithmic Foundations of Computer Science The Hardware World The Virtual Machine The Software World Applications Social Issues Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it. 43 L evel 1 of the text continues our exploration of algorithms and algorithmic problem solving—essential material for studying any branch of computer science. It first intro-duces methods for designing and representing algorithms. It then uses these ideas to develop solutions to some real-world problems, including an important application in medicine and biology. When judging the quality of an essay or book report, we do not look only at sentence structure, spelling, and punctuation. Although grammatical issues are important, we also must eval-uate the work’s style, for it is a combination of correctness and expressiveness that produces a written document of high qual-ity. So, too, for algorithms: Correctness is not the only measure of excellence. This section will present criteria for evaluating the quality and elegance of the algorithmic solutions that you develop. C H A P T E R Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience.
Index pages curate the most relevant extracts from our library of academic textbooks. They’ve been created using an in-house natural language model (NLM), each adding context and meaning to key research topics.









