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

Partager le livre
  1. 536 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

An Elementary Approach to Design and Analysis of Algorithms

Lekh Raj Vermani, Shalini Vermani

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

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

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que An Elementary Approach to Design and Analysis of Algorithms est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  An Elementary Approach to Design and Analysis of Algorithms par Lekh Raj Vermani, Shalini Vermani en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Programming Algorithms. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Éditeur
WSPC (EUROPE)
Année
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) aj ↔ aj–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 =...

Table des matiĂšres