Professional Documents
Culture Documents
& IT
Algorithms
Comprehensive Theory
with Solved Examples and Practice Questions
Publications
Publications
Algorithms
© Copyright by MADE EASY Publications Pvt. Ltd.
All rights are reserved. No part of this publication may be reproduced, stored in or introduced
into a retrieval system, or transmitted in any form or by any means (electronic, mechanical,
photo-copying, recording or otherwise), without the prior written permission of the above
mentioned publisher of this book.
© All rights reserved by MADE EASY PUBLICATIONS Pvt. Ltd. No part of this book may be reproduced or utilized in any form without
the written permission from the publisher.
Contents
Algorithms
Chapter 1 Chapter 4
Asymptotic Analysis of Algorithms����������� 3 Greedy Techniques�����������������������������������������90
1.1 Need for Performance Analysis.................................. 3 4.1 Introduction.....................................................................90
1.2 Worst, Average and Best Cases................................... 4 4.2 Basic Examples of Greedy Techniques...................91
1.3 Asymptotic Notations.................................................... 5 4.3 Greedy Technique Formalization.............................92
1.4 Analysis of Loops............................................................. 9 4.4 Knapsack (Fractional) Problem.................................93
1.5 Comparisons of Functions..........................................19 4.5 Representations of Graphs.........................................96
1.6 Asymptotic Behaviour of Polynomials...................20 4.6 Minimum Cost Spanning Tree (MCST) Problem.....98
Student Assignments.................................................................23 4.7 Single Source Shortest Path Problem (SSSPP)...... 107
4.8 Huffman Coding.......................................................... 117
Recurrence Relations������������������������������31
2.1 Introduction.....................................................................31 Chapter 5
2.2 Substitution Method....................................................32 Graph Based Algorithms......................139
2.3 Master Theorem.............................................................43 5.1 Introduction.................................................................. 139
Student Assignments..................................................................46 5.2 Graph Searching......................................................... 139
5.3 Directed Acyclic Graphs (DAG).............................. 151
Chapter 3 5.4 Topological Sorting.................................................... 152
3.1 Introduction.....................................................................55
3.2 Quick Sort.........................................................................55 Chapter 6
3.3 Strassen’s Matrix Multiplication................................60 Dynamic Programing...........................163
3.4 Merge Sort........................................................................63 6.1 Introduction.................................................................. 163
nnnn
(iii)