An Elementary Approach to Design and Analysis of Algorithms
eBook - ePub

An Elementary Approach to Design and Analysis of Algorithms

Lekh Raj Vermani, Shalini Vermani

Buch teilen
  1. 536 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

An Elementary Approach to Design and Analysis of Algorithms

Lekh Raj Vermani, Shalini Vermani

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

In computer science, an algorithm is an unambiguous specification of how to solve a class of problems. Algorithms can perform calculation, data processing and automated reasoning tasks.

As an effective method, an algorithm can be expressed within a finite amount of space and time and in a well-defined formal language for calculating a function. Starting from an initial state and initial input (perhaps empty), the instructions describe a computation that, when executed, proceeds through a finite number of well-defined successive states, eventually producing 'output' and terminating at a final ending state. The transition from one state to the next is not necessarily deterministic; some algorithms, known as randomized algorithms, incorporate random input.

This book introduces a set of concepts in solving problems computationally such as Growth of Functions; Backtracking; Divide and Conquer; Greedy Algorithms; Dynamic Programming; Elementary Graph Algorithms; Minimal Spanning Tree; Single-Source Shortest Paths; All Pairs Shortest Paths; Flow Networks; Polynomial Multiplication, to ways of solving NP-Complete Problems, supported with comprehensive, and detailed problems and solutions, making it an ideal resource to those studying computer science, computer engineering and information technology.

Contents:

  • Preface
  • About the Authors
  • Algorithms
  • Growth of Functions
  • Backtracking
  • Divide and Conquer
  • Greedy Algorithms
  • Dynamic Programming
  • Elementary Graph Algorithms
  • Minimal Spanning Tree
  • Single-Source Shortest Paths
  • All Pairs Shortest Paths
  • Flow Networks
  • Polynomial Multiplication, FFT and DFT
  • String Matching
  • Sorting Networks
  • NP-Complete Problems
  • Bibliography
  • Index


Readership: Students studying for degrees in computer science, computer engineering and information technology.Algorithms;Computer Science;Computer Engineering;Information Technology00

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist An Elementary Approach to Design and Analysis of Algorithms als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu An Elementary Approach to Design and Analysis of Algorithms von Lekh Raj Vermani, Shalini Vermani im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Programming Algorithms. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2019
ISBN
9781786346773

Chapter 1

Algorithms

In the subject of computer science the word algorithm, in general, refers to a method that can be used by a computer for the solution of a problem. As such the word algorithm does not simply mean a process, technique or method. Strictly speaking, it is a finite collection of well-defined computational techniques each of which is clear and unambiguous, capable of being performed with finite effort and terminates in a finite amount of time. Before an algorithm comes to play, a problem to be solved on computer is first converted into a mathematical problem called mathematical model. An algorithm is different from a program (computer program). Although algorithm is an easily understood procedure giving a set of logical instructions for solving the problem at hand, a program is written in a computer language giving the instructions that the computer understands.

1.1.Some Sorting Algorithms

We begin our study of algorithms by considering some sorting algorithms. Here we are given a sequence of non-negative integers a1, a2, . . . , an, not necessarily all distinct, the aim is to obtain a permutation of the a’s to get the numbers in a non-decreasing (or non-increasing) order i.e., to obtain a sequence a1′, a2′, . . . , an with {a1′, a2′, . . . , an} = {a1, a2, . . . , an} and a1′a2′
image
an. We restrict ourselves to obtaining a non-decreasing sequence.

1.1.1.Bubble sort

Among the sorting algorithms, this is most perhaps the easiest. In this algorithm an is first compared with an–1 and if an < an–1, an and an–1 are interchanged. Then an is compared with an–2 and if an < an–2, an and an–2 are interchanged and the process stops when we come to an ai such that ai < an. The process is then followed with an–1, then an–2 etc.
Algorithm 1.1. Bubble Sort Algorithm
1.For i = 1 to n − 1, do
2.forj = n to i + 1
3.if aj < aj–1, then
4.interchange (swap) ajaj–1
We will better explain this algorithm through two examples: one a sequence with all terms distinct and the other when all the terms are not necessarily distinct. We may not restrict ourselves to sequences of numbers alone but may consider sequences over any ordered set.
Example 1.1. Using bubble sort, rearrange the sequence
image
in alphabetical order.
Solution. This is a sequence of six terms all distinct. So i takes the values from 1 to 5. We express the sequence as a column denoting each word by the first letter of the word. We shall fully describe the internal loops for every i (refer to Table 1.1).
Observe that in the case i = 1, there is no change for j = 5, in the case of i = 2, there is no change for j = 6, 5, 4 and for i = 3, there is no change for j = 6, 5. At this stage the sequence is already sorted and, so, for i = 4 and 5, no changes are required. Hence the final sorted sequence is A, E, K, P, S, V or
image
Example 1.2. Using bubble sort, rearrange the sequence 2, 3, 6, 1, 0, 4, 8, 0 in non-decreasing order.
Table 1.1
image
Table 1.2(a)
image
Table 1.2(b)
image
Solution. This is a sequence of eight terms. So i takes values from 1 to 7. We express the sequence as a column and fully describe the internal loops for every i (as given in Tables 1.2(a) and 1.2(b)).
Observe that the array obtained in the last column of Table 1.2(b) is already sorted and, so, no changes are needed for i = 5, 6, 7. Also on the way, no changes were needed for i =...

Inhaltsverzeichnis