This document provides a summary of an algorithms course taught by Ali Zaib Khan. It includes the course code, title, instructor details, term, duration, and course contents which cover various algorithm design techniques. It also lists the required textbooks and discusses advance algorithm analysis. Finally, it categorizes different types of algorithms such as recursive, backtracking, divide-and-conquer, dynamic programming, greedy, branch-and-bound, brute force, and randomized algorithms.
This document provides an introduction to the analysis of algorithms. It discusses algorithm specification, performance analysis frameworks, and asymptotic notations used to analyze algorithms. Key aspects covered include time complexity, space complexity, worst-case analysis, and average-case analysis. Common algorithms like sorting and searching are also mentioned. The document outlines algorithm design techniques such as greedy methods, divide and conquer, and dynamic programming. It distinguishes between recursive and non-recursive algorithms and provides examples of complexity analysis for non-recursive algorithms.
2-Algorithms and Complexit data structurey.pdfishan743441
The document discusses algorithms design and complexity analysis. It defines an algorithm as a well-defined sequence of steps to solve a problem and notes that algorithms always take inputs and produce outputs. It discusses different approaches to designing algorithms like greedy, divide and conquer, and dynamic programming. It also covers analyzing algorithm complexity using asymptotic analysis by counting the number of basic operations and deriving the time complexity function in terms of input size.
Design and Analysis of Algorithm help to design the algorithms for solving different types of problems in Computer Science. It also helps to design and analyze the logic of how the program will work before developing the actual code for a program.
The document defines algorithms and discusses their importance. It provides three definitions of an algorithm, including a precise sequence of unambiguous and executable steps that terminates in a solution. Algorithms are useful because they allow problems to be solved repeatedly without needing to rediscover the solution each time. The term "algorithm" derives from the title of a 9th century book by Muhammad al-Khwarizmi, and his principle was to break problems into simple subproblems that are solved in order. An example algorithm for decimal to binary conversion is provided. Algorithms must have a precise, unambiguous, and terminating sequence of steps.
Chapter1.1 Introduction to design and analysis of algorithm.pptTekle12
This document discusses the design and analysis of algorithms. It begins with defining what an algorithm is - a well-defined computational procedure that takes inputs and produces outputs. It describes analyzing algorithms to determine their efficiency and comparing different algorithms that solve the same problem. The document outlines steps for designing algorithms, including understanding the problem, deciding a solution approach, designing the algorithm, proving correctness, and analyzing and coding it. It discusses using mathematical techniques like asymptotic analysis and Big O notation to analyze algorithms independently of implementations or inputs. The importance of analysis is also covered.
This document discusses the design and analysis of algorithms. It begins with defining what an algorithm is - a well-defined computational procedure that takes inputs and produces outputs. It describes analyzing algorithms to determine their efficiency and comparing different algorithms that solve the same problem. The document outlines steps for designing algorithms, including understanding the problem, deciding a solution approach, designing the algorithm, proving correctness, and analyzing and coding it. It discusses using mathematical techniques like asymptotic analysis and Big O notation to analyze algorithms independently of implementations or data. The importance of analyzing algorithms and techniques like divide-and-conquer are also covered.
This document provides an introduction to algorithms including definitions, characteristics, and the design process. It defines an algorithm as a finite set of unambiguous instructions to solve a problem. Key points:
- Algorithms must have input, output, be definitive, finite, and effective.
- The design process includes understanding the problem, developing a solution algorithm, proving correctness, analyzing efficiency, and coding.
- Examples of algorithm types are approximate, probabilistic, infinite, and heuristic.
- Pseudocode is commonly used to specify algorithms more clearly than natural language alone.
This document provides an introduction to the analysis of algorithms. It discusses algorithm specification, performance analysis frameworks, and asymptotic notations used to analyze algorithms. Key aspects covered include time complexity, space complexity, worst-case analysis, and average-case analysis. Common algorithms like sorting and searching are also mentioned. The document outlines algorithm design techniques such as greedy methods, divide and conquer, and dynamic programming. It distinguishes between recursive and non-recursive algorithms and provides examples of complexity analysis for non-recursive algorithms.
2-Algorithms and Complexit data structurey.pdfishan743441
The document discusses algorithms design and complexity analysis. It defines an algorithm as a well-defined sequence of steps to solve a problem and notes that algorithms always take inputs and produce outputs. It discusses different approaches to designing algorithms like greedy, divide and conquer, and dynamic programming. It also covers analyzing algorithm complexity using asymptotic analysis by counting the number of basic operations and deriving the time complexity function in terms of input size.
Design and Analysis of Algorithm help to design the algorithms for solving different types of problems in Computer Science. It also helps to design and analyze the logic of how the program will work before developing the actual code for a program.
The document defines algorithms and discusses their importance. It provides three definitions of an algorithm, including a precise sequence of unambiguous and executable steps that terminates in a solution. Algorithms are useful because they allow problems to be solved repeatedly without needing to rediscover the solution each time. The term "algorithm" derives from the title of a 9th century book by Muhammad al-Khwarizmi, and his principle was to break problems into simple subproblems that are solved in order. An example algorithm for decimal to binary conversion is provided. Algorithms must have a precise, unambiguous, and terminating sequence of steps.
Chapter1.1 Introduction to design and analysis of algorithm.pptTekle12
This document discusses the design and analysis of algorithms. It begins with defining what an algorithm is - a well-defined computational procedure that takes inputs and produces outputs. It describes analyzing algorithms to determine their efficiency and comparing different algorithms that solve the same problem. The document outlines steps for designing algorithms, including understanding the problem, deciding a solution approach, designing the algorithm, proving correctness, and analyzing and coding it. It discusses using mathematical techniques like asymptotic analysis and Big O notation to analyze algorithms independently of implementations or inputs. The importance of analysis is also covered.
This document discusses the design and analysis of algorithms. It begins with defining what an algorithm is - a well-defined computational procedure that takes inputs and produces outputs. It describes analyzing algorithms to determine their efficiency and comparing different algorithms that solve the same problem. The document outlines steps for designing algorithms, including understanding the problem, deciding a solution approach, designing the algorithm, proving correctness, and analyzing and coding it. It discusses using mathematical techniques like asymptotic analysis and Big O notation to analyze algorithms independently of implementations or data. The importance of analyzing algorithms and techniques like divide-and-conquer are also covered.
This document provides an introduction to algorithms including definitions, characteristics, and the design process. It defines an algorithm as a finite set of unambiguous instructions to solve a problem. Key points:
- Algorithms must have input, output, be definitive, finite, and effective.
- The design process includes understanding the problem, developing a solution algorithm, proving correctness, analyzing efficiency, and coding.
- Examples of algorithm types are approximate, probabilistic, infinite, and heuristic.
- Pseudocode is commonly used to specify algorithms more clearly than natural language alone.
The document discusses algorithms and their properties. It defines an algorithm as a finite sequence of steps to solve a specific problem. Algorithms must have a defined input and output, and can solve the same problem in different ways. Common algorithm types include recursive, dynamic programming, backtracking, divide and conquer, greedy, brute force, and heuristic algorithms. Efficiency is measured by time and space complexity. Variables are introduced as a way to store input, intermediate results, and output values in algorithms.
This document provides an overview of a lecture on designing and analyzing computer algorithms. It discusses key concepts like what an algorithm and program are, common algorithm design techniques like divide-and-conquer and greedy methods, and how to analyze algorithms' time and space complexity. The goals of analyzing algorithms are to understand their behavior, improve efficiency, and determine whether problems can be solved within a reasonable time frame.
The document provides an introduction to algorithms and their analysis. It defines an algorithm and lists its key criteria. It discusses different representations of algorithms including flowcharts and pseudocode. It also outlines the main areas of algorithm analysis: devising algorithms, validating them, analyzing performance, and testing programs. Finally, it provides examples of algorithms and their analysis including calculating time complexity based on counting operations.
This document discusses time and space complexity analysis of algorithms. It defines key concepts like computational problems, algorithms, inputs, outputs, and properties of good algorithms. It then explains space complexity and time complexity, and provides examples of typical time functions like constant, logarithmic, linear, quadratic, and exponential. An example C program for matrix multiplication is provided, with its time complexity analyzed as O(n^2) + O(n^3).
This document provides an overview of algorithms. It begins by discussing the origins and evolution of the term "algorithm" from its Arabic roots in the 9th century to its modern meaning of a well-defined computational procedure. The document then defines algorithms and their key characteristics such as being precise, unambiguous, and terminating after a finite number of steps. Common algorithm design techniques like divide-and-conquer, greedy algorithms, and dynamic programming are introduced. Examples of merge sort and finding the maximum element in a list are used to illustrate algorithm concepts.
The document discusses various types of algorithms:
1) Simple recursive algorithms solve base cases directly and recursively solve simpler subproblems.
2) Backtracking algorithms use depth-first search to test solutions and make choices recursively.
3) Divide and conquer algorithms divide problems into smaller subproblems, solve them recursively, and combine the solutions.
4) Dynamic programming algorithms store and reuse solutions to overlapping subproblems in a bottom-up manner.
Rajat Kumar submitted a project report for partial fulfillment of his B.Tech degree in computer science from Lovely Professional University. The project involved developing a snake game where the player moves a snake to eat fruit without touching itself or the border, which ends the game. The report provided background on data structures, algorithms, common data structures like stacks and queues, and algorithm design techniques like recursion, dynamic programming, and backtracking. It concluded that data structures are important tools that enable efficient information storage, data management, and algorithm design.
This document summarizes various algorithms topics including pattern matching, matrix multiplication, graph algorithms, algebraic problems, and NP-hard and NP-complete problems. It provides details on pattern matching techniques in computer science including exact string matching and applications. It also describes how to find the most efficient way to multiply a sequence of matrices by considering different orders of operations. Graph algorithms are introduced including directed and undirected graphs. Popular design approaches for algebraic problems such as divide-and-conquer, greedy techniques, and dynamic programming are outlined. Finally, the key differences between NP, NP-hard, and NP-complete problems are defined.
Euclid's algorithm is an efficient method for computing the greatest common divisor (GCD) of two numbers. It works by repeatedly finding the remainder of dividing the larger number by the smaller number, and then setting the larger number equal to the smaller number and the smaller number equal to the remainder, until the smaller number is zero. The last non-zero remainder is the GCD. The time complexity of Euclid's algorithm is O(log n) where n is the smaller of the two input numbers. Algorithm analysis techniques such as worst-case, best-case, average-case analysis and asymptotic notations can be used to formally analyze the efficiency of algorithms.
Euclid's algorithm is an efficient method for computing the greatest common divisor (GCD) of two numbers. It works by repeatedly finding the remainder of dividing the larger number by the smaller number, and then setting the larger number equal to the smaller number and the smaller number equal to the remainder, until the smaller number is zero. The last non-zero remainder is the GCD. The time complexity of Euclid's algorithm is O(log n) where n is the smaller of the two input numbers. Algorithm analysis techniques such as worst-case, best-case, average-case analysis and asymptotic notations can be used to formally analyze the efficiency of algorithms.
This document discusses the objectives and topics of the CS-311 Design and Analysis of Algorithms course. The objectives are to design algorithms using techniques like divide and conquer, develop problem solving skills, and analyze algorithms to compare efficiencies. An algorithm is defined as a sequence of unambiguous instructions to solve a problem. Sorting algorithms like selection sort and merge sort are presented as examples and analyzed based on time complexity. The process of solving a problem with algorithms includes understanding the problem, designing a solution, implementing and testing code, and analyzing performance. Key constructs like sequences, selections, iterations, and recursion are discussed for analyzing time complexity of algorithms.
Design and Analysis of Algorithm ppt for unit onessuserb7c8b8
The document outlines an algorithms course, including course details, objectives, and an introduction. The course code is 10211CS202 and name is Design and Analysis of Algorithms. It has 4 credits and meets for 6 hours per week. The course aims to teach fundamental techniques for effective problem solving, analyzing algorithm performance, and designing efficient algorithms. It covers topics like sorting, searching, and graph algorithms.
The document discusses stacks and queues as linear data structures. A stack follows LIFO (last in first out) where the last element inserted is the first removed. Common stack operations are push to insert and pop to remove elements. Stacks can be implemented using arrays or linked lists. A queue follows FIFO (first in first out) where the first element inserted is the first removed. Common queue operations are enqueue to insert and dequeue to remove elements. Queues can also be implemented using arrays or linked lists. Circular queues and priority queues are also introduced.
The document discusses stacks and queues as linear data structures. A stack follows LIFO (last in first out) where the last element inserted is the first to be removed. Common stack operations are push to add an element and pop to remove an element. Stacks can be implemented using arrays or linked lists. A queue follows FIFO (first in first out) where the first element inserted is the first to be removed. Common queue operations are enqueue to add an element and dequeue to remove an element. Queues can also be implemented using arrays or linked lists. Circular queues and priority queues are also discussed briefly.
This document defines and describes various types of algorithms. It begins by explaining that an algorithm is a step-by-step procedure for solving problems or processing data, and that they are used in mathematics and computer science. It then categorizes algorithms into different types, including recursive, divide and conquer, dynamic programming, greedy, branch and bound, brute force, and randomized algorithms. Examples are provided to illustrate each type of algorithm.
"A short and knowledgeable concept about Algorithm "CHANDAN KUMAR
This document discusses algorithms and their properties. It defines an algorithm as a finite set of well-defined instructions to solve a problem. There are five criteria for writing algorithms: they must have inputs and outputs, be definite, finite, and effective. Algorithms use notation like step numbers, comments, and termination statements. Common algorithm types are dynamic programming, greedy, brute force, and divide and conquer. An example algorithm calculates the average of four numbers by reading inputs, computing the sum, calculating the average, and writing the output. Key patterns in algorithms are sequences, decisions, and repetitions.
01 Introduction to analysis of Algorithms.pptxssuser586772
An algorithm is a set of steps of operations to solve a problem performing calculation, data processing, and automated reasoning tasks.
An algorithm is an efficient method that can be expressed within finite amount of Time and space.
The important aspects of algorithm design include creating an efficient algorithm to solve a problem in an efficient way using minimum time and space.
To solve a problem, different approaches can be followed. Some of them can be efficient with respect to time consumption, whereas other approaches may be memory efficient. To Evaluate An Algorithm we have to Satisfy the following Criteria:
INPUT: The Algorithm should be given zero or more input.
OUTPUT: At least one quantity is produced. For each input the algorithm produced value from specific task.
DEFINITENESS: Each instruction is clear and unambiguous.
FINITENESS: If we trace out the instructions of an algorithm, then for all cases, the algorithm terminates after a finite number of steps.
EFFECTIVENESS: Every instruction must very basic so that it can be carried out, in principle, by a person using only pencil & paper.Algorithm : Systematic logical approach which is a well-defined, step-by-step procedure that allows a computer to solve a problem.
Pseudocode : It is a simpler version of a programming code in plain English which uses short phrases to write code for a program before it is implemented in a specific programming language.
Program : It is exact code written for problem following all the rules of the programming language.Algorithm can be described (Represent) in four ways.
Natural language like English:
When this way is chooses, care should be taken, we
should ensure that each & every statement is definite.
(no ambiguity)
2. Graphic representation called flowchart:
This method will work well when the algorithm is small& simple.
3. Pseudo-code Method:
In this method, we should typically describe algorithms as
program, which resembles language like Pascal & Algol
(Algorithmic Language).
4.Programming Language:
we have to use programming language to write algorithms like
C, C++,JAVA etc.Comments begin with // and continue until the end of line.
Blocks are indicated with matching braces { and }.
An identifier begins with a letter. The data types of variables are not explicitly declared.
node= record
{
data type 1 data 1;
data type n data n;
node *link;
}
4. There are two Boolean values TRUE and FALSE.
Logical Operators
AND, OR, NOT
Relational Operators
<, <=,>,>=, =, !=
1.How to create an algorithm: To create an algorithm we have following design technique
a) Divide & Conquer
b) Greedy method
c) Dynamic Programming
d) Branch & Bound
e) Backtracking
2.How to validate an algorithm:
Once an algorithm is created it is necessary to show that it computes the correct Pr
This document provides an introduction to the CS-701 Advanced Analysis of Algorithms course. It includes the course objectives, which are to design and analyze modern algorithms and evaluate their efficiency. The instructor and contact information are provided. The document outlines the course contents, including topics like sorting algorithms, graph algorithms, and complexity theory. It also discusses what algorithms are, how to represent them, and examples of algorithm applications. Common algorithm design techniques like greedy algorithms and heuristics are introduced.
The document provides an overview of algorithms, including definitions, types, characteristics, and analysis. It begins with step-by-step algorithms to add two numbers and describes the difference between algorithms and pseudocode. It then covers algorithm design approaches, characteristics, classification based on implementation and logic, and analysis methods like a priori and posteriori. The document emphasizes that algorithm analysis estimates resource needs like time and space complexity based on input size.
Ants coony optimiztion problem in Advance analysis of algorithmsALIZAIB KHAN
This document provides an introduction to ant colony optimization (ACO), beginning with its biological inspiration of real ant colonies. It then discusses how ACO can be used to solve NP-hard combinatorial optimization problems by mapping them to a construction graph and having artificial ants build solutions in a stochastic manner. The core components of the ACO metaheuristic are described, including how ants construct solutions, deposit pheromone trails, and how pheromones are updated over time. Finally, the document summarizes how ACO has been applied to the traveling salesman problem.
Ant Colony Optimization algorithms in ADSAALIZAIB KHAN
Ant colony optimization is a metaheuristic algorithm inspired by the behavior of ants in nature. Ants communicate information about paths between their nest and food sources via pheromone trails. In ACO, artificial ants probabilistically construct solutions to optimization problems and update pheromone trails to favor shorter paths. The algorithm iteratively converges to an optimal solution as the probability of choosing shorter paths increases over time. ACO has been successfully applied to solve traveling salesperson problems and other NP-hard combinatorial optimization problems.
The document discusses algorithms and their properties. It defines an algorithm as a finite sequence of steps to solve a specific problem. Algorithms must have a defined input and output, and can solve the same problem in different ways. Common algorithm types include recursive, dynamic programming, backtracking, divide and conquer, greedy, brute force, and heuristic algorithms. Efficiency is measured by time and space complexity. Variables are introduced as a way to store input, intermediate results, and output values in algorithms.
This document provides an overview of a lecture on designing and analyzing computer algorithms. It discusses key concepts like what an algorithm and program are, common algorithm design techniques like divide-and-conquer and greedy methods, and how to analyze algorithms' time and space complexity. The goals of analyzing algorithms are to understand their behavior, improve efficiency, and determine whether problems can be solved within a reasonable time frame.
The document provides an introduction to algorithms and their analysis. It defines an algorithm and lists its key criteria. It discusses different representations of algorithms including flowcharts and pseudocode. It also outlines the main areas of algorithm analysis: devising algorithms, validating them, analyzing performance, and testing programs. Finally, it provides examples of algorithms and their analysis including calculating time complexity based on counting operations.
This document discusses time and space complexity analysis of algorithms. It defines key concepts like computational problems, algorithms, inputs, outputs, and properties of good algorithms. It then explains space complexity and time complexity, and provides examples of typical time functions like constant, logarithmic, linear, quadratic, and exponential. An example C program for matrix multiplication is provided, with its time complexity analyzed as O(n^2) + O(n^3).
This document provides an overview of algorithms. It begins by discussing the origins and evolution of the term "algorithm" from its Arabic roots in the 9th century to its modern meaning of a well-defined computational procedure. The document then defines algorithms and their key characteristics such as being precise, unambiguous, and terminating after a finite number of steps. Common algorithm design techniques like divide-and-conquer, greedy algorithms, and dynamic programming are introduced. Examples of merge sort and finding the maximum element in a list are used to illustrate algorithm concepts.
The document discusses various types of algorithms:
1) Simple recursive algorithms solve base cases directly and recursively solve simpler subproblems.
2) Backtracking algorithms use depth-first search to test solutions and make choices recursively.
3) Divide and conquer algorithms divide problems into smaller subproblems, solve them recursively, and combine the solutions.
4) Dynamic programming algorithms store and reuse solutions to overlapping subproblems in a bottom-up manner.
Rajat Kumar submitted a project report for partial fulfillment of his B.Tech degree in computer science from Lovely Professional University. The project involved developing a snake game where the player moves a snake to eat fruit without touching itself or the border, which ends the game. The report provided background on data structures, algorithms, common data structures like stacks and queues, and algorithm design techniques like recursion, dynamic programming, and backtracking. It concluded that data structures are important tools that enable efficient information storage, data management, and algorithm design.
This document summarizes various algorithms topics including pattern matching, matrix multiplication, graph algorithms, algebraic problems, and NP-hard and NP-complete problems. It provides details on pattern matching techniques in computer science including exact string matching and applications. It also describes how to find the most efficient way to multiply a sequence of matrices by considering different orders of operations. Graph algorithms are introduced including directed and undirected graphs. Popular design approaches for algebraic problems such as divide-and-conquer, greedy techniques, and dynamic programming are outlined. Finally, the key differences between NP, NP-hard, and NP-complete problems are defined.
Euclid's algorithm is an efficient method for computing the greatest common divisor (GCD) of two numbers. It works by repeatedly finding the remainder of dividing the larger number by the smaller number, and then setting the larger number equal to the smaller number and the smaller number equal to the remainder, until the smaller number is zero. The last non-zero remainder is the GCD. The time complexity of Euclid's algorithm is O(log n) where n is the smaller of the two input numbers. Algorithm analysis techniques such as worst-case, best-case, average-case analysis and asymptotic notations can be used to formally analyze the efficiency of algorithms.
Euclid's algorithm is an efficient method for computing the greatest common divisor (GCD) of two numbers. It works by repeatedly finding the remainder of dividing the larger number by the smaller number, and then setting the larger number equal to the smaller number and the smaller number equal to the remainder, until the smaller number is zero. The last non-zero remainder is the GCD. The time complexity of Euclid's algorithm is O(log n) where n is the smaller of the two input numbers. Algorithm analysis techniques such as worst-case, best-case, average-case analysis and asymptotic notations can be used to formally analyze the efficiency of algorithms.
This document discusses the objectives and topics of the CS-311 Design and Analysis of Algorithms course. The objectives are to design algorithms using techniques like divide and conquer, develop problem solving skills, and analyze algorithms to compare efficiencies. An algorithm is defined as a sequence of unambiguous instructions to solve a problem. Sorting algorithms like selection sort and merge sort are presented as examples and analyzed based on time complexity. The process of solving a problem with algorithms includes understanding the problem, designing a solution, implementing and testing code, and analyzing performance. Key constructs like sequences, selections, iterations, and recursion are discussed for analyzing time complexity of algorithms.
Design and Analysis of Algorithm ppt for unit onessuserb7c8b8
The document outlines an algorithms course, including course details, objectives, and an introduction. The course code is 10211CS202 and name is Design and Analysis of Algorithms. It has 4 credits and meets for 6 hours per week. The course aims to teach fundamental techniques for effective problem solving, analyzing algorithm performance, and designing efficient algorithms. It covers topics like sorting, searching, and graph algorithms.
The document discusses stacks and queues as linear data structures. A stack follows LIFO (last in first out) where the last element inserted is the first removed. Common stack operations are push to insert and pop to remove elements. Stacks can be implemented using arrays or linked lists. A queue follows FIFO (first in first out) where the first element inserted is the first removed. Common queue operations are enqueue to insert and dequeue to remove elements. Queues can also be implemented using arrays or linked lists. Circular queues and priority queues are also introduced.
The document discusses stacks and queues as linear data structures. A stack follows LIFO (last in first out) where the last element inserted is the first to be removed. Common stack operations are push to add an element and pop to remove an element. Stacks can be implemented using arrays or linked lists. A queue follows FIFO (first in first out) where the first element inserted is the first to be removed. Common queue operations are enqueue to add an element and dequeue to remove an element. Queues can also be implemented using arrays or linked lists. Circular queues and priority queues are also discussed briefly.
This document defines and describes various types of algorithms. It begins by explaining that an algorithm is a step-by-step procedure for solving problems or processing data, and that they are used in mathematics and computer science. It then categorizes algorithms into different types, including recursive, divide and conquer, dynamic programming, greedy, branch and bound, brute force, and randomized algorithms. Examples are provided to illustrate each type of algorithm.
"A short and knowledgeable concept about Algorithm "CHANDAN KUMAR
This document discusses algorithms and their properties. It defines an algorithm as a finite set of well-defined instructions to solve a problem. There are five criteria for writing algorithms: they must have inputs and outputs, be definite, finite, and effective. Algorithms use notation like step numbers, comments, and termination statements. Common algorithm types are dynamic programming, greedy, brute force, and divide and conquer. An example algorithm calculates the average of four numbers by reading inputs, computing the sum, calculating the average, and writing the output. Key patterns in algorithms are sequences, decisions, and repetitions.
01 Introduction to analysis of Algorithms.pptxssuser586772
An algorithm is a set of steps of operations to solve a problem performing calculation, data processing, and automated reasoning tasks.
An algorithm is an efficient method that can be expressed within finite amount of Time and space.
The important aspects of algorithm design include creating an efficient algorithm to solve a problem in an efficient way using minimum time and space.
To solve a problem, different approaches can be followed. Some of them can be efficient with respect to time consumption, whereas other approaches may be memory efficient. To Evaluate An Algorithm we have to Satisfy the following Criteria:
INPUT: The Algorithm should be given zero or more input.
OUTPUT: At least one quantity is produced. For each input the algorithm produced value from specific task.
DEFINITENESS: Each instruction is clear and unambiguous.
FINITENESS: If we trace out the instructions of an algorithm, then for all cases, the algorithm terminates after a finite number of steps.
EFFECTIVENESS: Every instruction must very basic so that it can be carried out, in principle, by a person using only pencil & paper.Algorithm : Systematic logical approach which is a well-defined, step-by-step procedure that allows a computer to solve a problem.
Pseudocode : It is a simpler version of a programming code in plain English which uses short phrases to write code for a program before it is implemented in a specific programming language.
Program : It is exact code written for problem following all the rules of the programming language.Algorithm can be described (Represent) in four ways.
Natural language like English:
When this way is chooses, care should be taken, we
should ensure that each & every statement is definite.
(no ambiguity)
2. Graphic representation called flowchart:
This method will work well when the algorithm is small& simple.
3. Pseudo-code Method:
In this method, we should typically describe algorithms as
program, which resembles language like Pascal & Algol
(Algorithmic Language).
4.Programming Language:
we have to use programming language to write algorithms like
C, C++,JAVA etc.Comments begin with // and continue until the end of line.
Blocks are indicated with matching braces { and }.
An identifier begins with a letter. The data types of variables are not explicitly declared.
node= record
{
data type 1 data 1;
data type n data n;
node *link;
}
4. There are two Boolean values TRUE and FALSE.
Logical Operators
AND, OR, NOT
Relational Operators
<, <=,>,>=, =, !=
1.How to create an algorithm: To create an algorithm we have following design technique
a) Divide & Conquer
b) Greedy method
c) Dynamic Programming
d) Branch & Bound
e) Backtracking
2.How to validate an algorithm:
Once an algorithm is created it is necessary to show that it computes the correct Pr
This document provides an introduction to the CS-701 Advanced Analysis of Algorithms course. It includes the course objectives, which are to design and analyze modern algorithms and evaluate their efficiency. The instructor and contact information are provided. The document outlines the course contents, including topics like sorting algorithms, graph algorithms, and complexity theory. It also discusses what algorithms are, how to represent them, and examples of algorithm applications. Common algorithm design techniques like greedy algorithms and heuristics are introduced.
The document provides an overview of algorithms, including definitions, types, characteristics, and analysis. It begins with step-by-step algorithms to add two numbers and describes the difference between algorithms and pseudocode. It then covers algorithm design approaches, characteristics, classification based on implementation and logic, and analysis methods like a priori and posteriori. The document emphasizes that algorithm analysis estimates resource needs like time and space complexity based on input size.
Ants coony optimiztion problem in Advance analysis of algorithmsALIZAIB KHAN
This document provides an introduction to ant colony optimization (ACO), beginning with its biological inspiration of real ant colonies. It then discusses how ACO can be used to solve NP-hard combinatorial optimization problems by mapping them to a construction graph and having artificial ants build solutions in a stochastic manner. The core components of the ACO metaheuristic are described, including how ants construct solutions, deposit pheromone trails, and how pheromones are updated over time. Finally, the document summarizes how ACO has been applied to the traveling salesman problem.
Ant Colony Optimization algorithms in ADSAALIZAIB KHAN
Ant colony optimization is a metaheuristic algorithm inspired by the behavior of ants in nature. Ants communicate information about paths between their nest and food sources via pheromone trails. In ACO, artificial ants probabilistically construct solutions to optimization problems and update pheromone trails to favor shorter paths. The algorithm iteratively converges to an optimal solution as the probability of choosing shorter paths increases over time. ACO has been successfully applied to solve traveling salesperson problems and other NP-hard combinatorial optimization problems.
decison tree and rules in data mining techniquesALIZAIB KHAN
Decision trees are a popular supervised learning method that can be used for classification and prediction. They work by splitting a dataset into purer subsets based on the values of predictor variables. The C4.5 algorithm is commonly used to build decision trees in a top-down recursive divide-and-conquer manner by selecting the attribute that produces the highest information gain at each step. It then prunes the fully grown tree to avoid overfitting. Decision trees can be converted to classification rules for interpretation. An example decision tree was built to predict student course enrollment based on attributes like gender, income, and employment sector.
Artificial Neural Networks for data miningALIZAIB KHAN
Dr. Kamal Gulati's document discusses artificial neural networks and their application for data mining and classification. Specifically, it describes how neural networks can be used to:
1. Classify customers into risk categories like "good", "fair", or "poor" based on their attributes from a training dataset.
2. Build a decision tree to visualize the classification rules and extract them as "if-then" statements.
3. Develop multi-layer neural networks composed of processing elements called perceptrons that can learn patterns in complex data and perform tasks like prediction, classification, and clustering.
The document discusses regular and nonregular languages. It defines regular languages using regular expressions, non-deterministic finite automata (NFA), transition graphs (TG), and deterministic finite automata (DFA). It presents theorems showing that operations like union, concatenation, and Kleene star preserve regularity. It also discusses how the complement of a regular language is regular and how the intersection of two regular languages is regular. Finally, it notes that some languages are nonregular and cannot be defined by regular expressions.
This document discusses closure properties of regular languages and finite automata minimization. It begins by covering more closure properties, including that regular languages are closed under concatenation and the Kleene star operation. It then discusses regular expressions and Kleene's theorem. The remainder of the document focuses on minimizing deterministic finite automata (DFAs), including defining the minimization problem, providing an algorithm to minimize DFAs, and illustrating the algorithm on an example.
This document provides an introduction to algorithms and their design and analysis. It defines an algorithm as a well-defined set of steps to solve a problem and notes they must be unambiguous and produce the same output each time. Examples are given of finding the largest number in a list and sorting algorithms. The use of algorithms in computer systems is discussed as well as why their design and analysis is important for problem solving and programming.
This document discusses different techniques for drawing circles in computer graphics, including Cartesian coordinates, polar coordinates, and the midpoint circle algorithm. Cartesian coordinates directly use the circle equation to plot points, but is inefficient due to calculations and gaps. Polar coordinates express the circle in parametric form using angle and radius, which solves the gap issue but still requires floating-point calculations. The midpoint circle algorithm derives a decision parameter to iteratively select the next point using integer increments, making it the most efficient method.
State of Artificial intelligence Report 2023kuntobimo2016
Artificial intelligence (AI) is a multidisciplinary field of science and engineering whose goal is to create intelligent machines.
We believe that AI will be a force multiplier on technological progress in our increasingly digital, data-driven world. This is because everything around us today, ranging from culture to consumer products, is a product of intelligence.
The State of AI Report is now in its sixth year. Consider this report as a compilation of the most interesting things we’ve seen with a goal of triggering an informed conversation about the state of AI and its implication for the future.
We consider the following key dimensions in our report:
Research: Technology breakthroughs and their capabilities.
Industry: Areas of commercial application for AI and its business impact.
Politics: Regulation of AI, its economic implications and the evolving geopolitics of AI.
Safety: Identifying and mitigating catastrophic risks that highly-capable future AI systems could pose to us.
Predictions: What we believe will happen in the next 12 months and a 2022 performance review to keep us honest.
End-to-end pipeline agility - Berlin Buzzwords 2024Lars Albertsson
We describe how we achieve high change agility in data engineering by eliminating the fear of breaking downstream data pipelines through end-to-end pipeline testing, and by using schema metaprogramming to safely eliminate boilerplate involved in changes that affect whole pipelines.
A quick poll on agility in changing pipelines from end to end indicated a huge span in capabilities. For the question "How long time does it take for all downstream pipelines to be adapted to an upstream change," the median response was 6 months, but some respondents could do it in less than a day. When quantitative data engineering differences between the best and worst are measured, the span is often 100x-1000x, sometimes even more.
A long time ago, we suffered at Spotify from fear of changing pipelines due to not knowing what the impact might be downstream. We made plans for a technical solution to test pipelines end-to-end to mitigate that fear, but the effort failed for cultural reasons. We eventually solved this challenge, but in a different context. In this presentation we will describe how we test full pipelines effectively by manipulating workflow orchestration, which enables us to make changes in pipelines without fear of breaking downstream.
Making schema changes that affect many jobs also involves a lot of toil and boilerplate. Using schema-on-read mitigates some of it, but has drawbacks since it makes it more difficult to detect errors early. We will describe how we have rejected this tradeoff by applying schema metaprogramming, eliminating boilerplate but keeping the protection of static typing, thereby further improving agility to quickly modify data pipelines without fear.
Analysis insight about a Flyball dog competition team's performanceroli9797
Insight of my analysis about a Flyball dog competition team's last year performance. Find more: https://github.com/rolandnagy-ds/flyball_race_analysis/tree/main
Learn SQL from basic queries to Advance queriesmanishkhaire30
Dive into the world of data analysis with our comprehensive guide on mastering SQL! This presentation offers a practical approach to learning SQL, focusing on real-world applications and hands-on practice. Whether you're a beginner or looking to sharpen your skills, this guide provides the tools you need to extract, analyze, and interpret data effectively.
Key Highlights:
Foundations of SQL: Understand the basics of SQL, including data retrieval, filtering, and aggregation.
Advanced Queries: Learn to craft complex queries to uncover deep insights from your data.
Data Trends and Patterns: Discover how to identify and interpret trends and patterns in your datasets.
Practical Examples: Follow step-by-step examples to apply SQL techniques in real-world scenarios.
Actionable Insights: Gain the skills to derive actionable insights that drive informed decision-making.
Join us on this journey to enhance your data analysis capabilities and unlock the full potential of SQL. Perfect for data enthusiasts, analysts, and anyone eager to harness the power of data!
#DataAnalysis #SQL #LearningSQL #DataInsights #DataScience #Analytics
Global Situational Awareness of A.I. and where its headedvikram sood
You can see the future first in San Francisco.
Over the past year, the talk of the town has shifted from $10 billion compute clusters to $100 billion clusters to trillion-dollar clusters. Every six months another zero is added to the boardroom plans. Behind the scenes, there’s a fierce scramble to secure every power contract still available for the rest of the decade, every voltage transformer that can possibly be procured. American big business is gearing up to pour trillions of dollars into a long-unseen mobilization of American industrial might. By the end of the decade, American electricity production will have grown tens of percent; from the shale fields of Pennsylvania to the solar farms of Nevada, hundreds of millions of GPUs will hum.
The AGI race has begun. We are building machines that can think and reason. By 2025/26, these machines will outpace college graduates. By the end of the decade, they will be smarter than you or I; we will have superintelligence, in the true sense of the word. Along the way, national security forces not seen in half a century will be un-leashed, and before long, The Project will be on. If we’re lucky, we’ll be in an all-out race with the CCP; if we’re unlucky, an all-out war.
Everyone is now talking about AI, but few have the faintest glimmer of what is about to hit them. Nvidia analysts still think 2024 might be close to the peak. Mainstream pundits are stuck on the wilful blindness of “it’s just predicting the next word”. They see only hype and business-as-usual; at most they entertain another internet-scale technological change.
Before long, the world will wake up. But right now, there are perhaps a few hundred people, most of them in San Francisco and the AI labs, that have situational awareness. Through whatever peculiar forces of fate, I have found myself amongst them. A few years ago, these people were derided as crazy—but they trusted the trendlines, which allowed them to correctly predict the AI advances of the past few years. Whether these people are also right about the next few years remains to be seen. But these are very smart people—the smartest people I have ever met—and they are the ones building this technology. Perhaps they will be an odd footnote in history, or perhaps they will go down in history like Szilard and Oppenheimer and Teller. If they are seeing the future even close to correctly, we are in for a wild ride.
Let me tell you what we see.
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Data and AI
Discussion on Vector Databases, Unstructured Data and AI
https://www.meetup.com/unstructured-data-meetup-new-york/
This meetup is for people working in unstructured data. Speakers will come present about related topics such as vector databases, LLMs, and managing data at scale. The intended audience of this group includes roles like machine learning engineers, data scientists, data engineers, software engineers, and PMs.This meetup was formerly Milvus Meetup, and is sponsored by Zilliz maintainers of Milvus.
Codeless Generative AI Pipelines
(GenAI with Milvus)
https://ml.dssconf.pl/user.html#!/lecture/DSSML24-041a/rate
Discover the potential of real-time streaming in the context of GenAI as we delve into the intricacies of Apache NiFi and its capabilities. Learn how this tool can significantly simplify the data engineering workflow for GenAI applications, allowing you to focus on the creative aspects rather than the technical complexities. I will guide you through practical examples and use cases, showing the impact of automation on prompt building. From data ingestion to transformation and delivery, witness how Apache NiFi streamlines the entire pipeline, ensuring a smooth and hassle-free experience.
Timothy Spann
https://www.youtube.com/@FLaNK-Stack
https://medium.com/@tspann
https://www.datainmotion.dev/
milvus, unstructured data, vector database, zilliz, cloud, vectors, python, deep learning, generative ai, genai, nifi, kafka, flink, streaming, iot, edge
2. COURSE
Course Code:
Course Title: Design and Analysis of Algorithm
Instructor: Ali Zaib Khan
Email Address: alizaib269@gmail.com
Term (Semester): Spring 2020
Duration: 15/16 Weeks
3. PROFILE & COORDINATES
Profile:
Name: Ali Zaib Khan
M.Phil (Computer Science) Minhaj University Lahore (MUL)
Bs (Software Engineering) Government College
University Faisalabad (GCUF)
RESEARCH :Thesis
Enhancement in medical Field using Artificial Intelligence
Projects:
Motion Sensor Camera Using MATLAB
Coordinates:
Email: alizaib269@gmail.com
3
4. Course Contents
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Algorithm analysis
Algorithm design
Divide-and-conquer
Greedy approach
Graph algorithms
Graph searching
Topological sort
approach
Minimum spanning tree
Shortest paths
Backtracking and its applications in games.
String matching.
Longest common subsequence.
Theory of NP-completeness.
7
Design
&
Analysis
of
Algorithms
5. Text Books
• Course Book
• Introduction to Algorithms, 3rd edition by Cormen, Leisersen,
Rivest and Stein.
• Reference Books
• The Algorithm Design Manual - Steven S.
• Algorithms – Dasgupta, Papadimitriou, Vazirani
• Some relevant important material from internet as well
8
Design
&
Analysis
of
Algorithms
7. who invented algorithm
Algorithms have a long history and the word can be traced
back to the 9th century. At this time the Persian scientist,
astronomer and mathematician Abdullah Muhammad bin
Musa al-Khwarizmi, often cited as “The father of
Algebra”, was indirect responsible for the creation of the
term “Algorithm”.
8. Algorithms are the ideas behind computer programs.
• An algorithm is an exact specification of how to solve a
computational problem
• An algorithm must specify every step completely, so a
computer can implement it without any further
“understanding”
• An algorithm must work for all possible inputs of the
problem.
• Algorithms must be:
Correct: For each input produce an appropriate output
Efficient: run as quickly as possible, and use as little memory
as possible – more about this later
• There can be many different algorithms for each
computational problem.
Introduction
9. Introduction
• An algorithm is a set of instructions to be followed to solve a
problem. Another word, an algorithm is a complete set of
rules that transform the input into the output in a finite
number of steps.
• There can be more than one solution (more than one
algorithm) to solve a given problem.
• An algorithm can be implemented using different
programming languages on different platforms.
• An algorithm should correctly solve the problem.
• e.g., for sorting, this means even if (1) the input is already
sorted, or (2) it contains repeated elements.
• Once we have a correct algorithm for a problem, we have to
determine the efficiency of that algorithm.
13
Design
&
Analysis
of
Algorithms
10. Design & Analysis of
Algorithms
Aspects of studying algorithms:
1. Designing algorithms:
•
•
•
putting the pieces of the puzzles together,
choosing data structures,
selecting the basic approaches to the solution of the
problem,
• The most popular design strategies are divide&conquer,greedy,
dynamic prog., backtracking, and branch&bound.
2. Expressing and implementing the algorithm
Concerns are:
•
•
•
•
clearness
conciseness
Effectiveness
etc. 15
Design
&
Analysis
of
Algorithms
11. Design & Analysis of
Algorithms
3. Analyzing the algorithm
Algorithm analysis is assessing the time and space resources
required by an algorithm as a function of the size of the problem,
without actually implementing the algorithm.
4. Compare
enough
UB and LB to see if your solution is good
Analyzing the algorithm gives us the
problem
Analyzing the problem gives us the
problem
upper bound to solve the
lower bound to solve the
5. Validate the algorithm
We show that the algorithm computes
possible legal (or given) inputs
the correct answer for all 16
Design
&
Analysis
of
Algorithms
12. Design & Analysis of
Algorithms
6. Verifying the algorithm (or program)
An algorithm is said to be correct (verified) if, for every input
instance, it halts with the correct output.
7. Testing algorithms
There are two phases;
Debugging: The process of executing programs on sample
data sets to determine if faulty results occur, and if so, to
correct them.
“Debugging can only point to the presence of errors, but not to
their absence”
Profiling: the process of executing a correct program on
17
various data sets and measuring the time (and space) it takes
to compute the results.
Design
&
Analysis
of
Algorithms
13. Algorithmic Performance
There are two aspects of algorithmic performance:
• Time
•
•
•
Instructions take time.
How fast does the algorithm perform?
What affects its runtime?
• Space
•
•
•
We
Data structures take space
What kind of data structures can be used?
How does choice of data structure affect the runtime?
will focus on time:
• How to estimate the time required for an algorithm
• How to reduce the time required 18
Design
&
Analysis
of
Algorithms
14. Algorithmic Analysis
• Analysis of Algorithms is the area of computer
science that provides tools to analyze the
efficiency of different methods of solutions.
• How do we compare the time efficiency of
algorithms that solve the same problem?
two
Naïve Approach: implement these algorithms in
a programming language (i.e., C++), and run
them to compare their time requirements.
19
Design
&
Analysis
of
Algorithms
16. ALGORITHM CLASSIFICATION
Algorithms that use a similar problem-
solving approach can be grouped together
This classification scheme is neither
exhaustive nor disjoint
The purpose is not to be able to classify an
algorithm as one type or another, but to
highlight the various ways in which a problem
can be attacked.
17. A SHORT LIST OF CATEGORIES
Algorithm types we will consider include:
Simple recursive algorithms
Backtracking algorithms
Divide and conquer algorithms
Dynamic programming algorithms
Greedy algorithms
Branch and bound algorithms
Brute force algorithms
Randomized algorithms
18. SIMPLE RECURSIVE ALGORITHMS I
A simple recursive algorithm:
Solves the base cases directly
recurs with a simpler subproblem
Does some extra work to convert the solution to
the simpler subproblem into a solution to the
given problem
We call these “simple” because several of
the other algorithm types are inherently
recursive
19. EXAMPLE RECURSIVE ALGORITHMS
To count the number of elements in a list:
If the list is empty, return zero; otherwise,
Step past the first element, and count the remaining
elements in the list
Add one to the result
To test if a value occurs in a list:
If the list is empty, return false; otherwise,
If the first thing in the list is the given value, return
true; otherwise
Step past the first element, and test whether the
value occurs in the remainder of the list
20. BACKTRACKING ALGORITHMS
Backtracking algorithms are based on a
depth-first recursive search
A backtracking algorithm:
Tests to see if a solution has been found, and if
so, returns it; otherwise
For each choice that can be made at this point,
Make that choice
Recur
If the recursion returns a solution, return it
If no choices remain, return failure
21. EXAMPLE BACKTRACKING ALGORITHM
To color a map with no more than four colors:
color(Country n)
If all countries have been colored (n > number of
countries) return success; otherwise,
For each color c of four colors,
If country n is not adjacent to a country that has
been colored c
Color country n with color c
recursivly color country n+1
If successful, return success
Return failure (if loop exits)
22. DIVIDE AND CONQUER
A divide and conquer algorithm consists of
two parts:
Divide the problem into smaller subproblems of
the same type, and solve these subproblems
recursively
Combine the solutions to the subproblems into
a solution to the original problem
Traditionally, an algorithm is only called
divide and conquer if it contains two or more
recursive calls
23. EXAMPLES
Quicksort:
Partition the array into two parts, and quicksort
each of the parts
No additional work is required to combine the
two sorted parts
Mergesort:
Cut the array in half, and mergesort each half
Combine the two sorted arrays into a single
sorted array by merging them
24. BINARY TREE LOOKUP
Here’s how to look up something in a sorted
binary tree:
Compare the key to the value in the root
If the two values are equal, report success
If the key is less, search the left subtree
If the key is greater, search the right subtree
This is not a divide and conquer algorithm
because, although there are two recursive
calls, only one is used at each level of the
recursion
25. FIBONACCI NUMBERS
To find the nth Fibonacci number:
If n is zero or one, return one; otherwise,
Compute fibonacci(n-1) and fibonacci(n-2)
Return the sum of these two numbers
This is an expensive algorithm
It requires O(fibonacci(n)) time
This is equivalent to exponential time, that is,
O(2n)
26. DYNAMIC PROGRAMMING ALGORITHMS
A dynamic programming algorithm remembers past results
and uses them to find new results
Dynamic programming is generally used for optimization
problems
Multiple solutions exist, need to find the “best” one
Requires “optimal substructure” and “overlapping subproblems”
Optimal substructure: Optimal solution contains optimal solutions
to subproblems
Overlapping subproblems: Solutions to subproblems can be
stored and reused in a bottom-up fashion
This differs from Divide and Conquer, where subproblems
generally need not overlap
27. FIBONACCI NUMBERS AGAIN
To find the nth Fibonacci number:
If n is zero or one, return one; otherwise,
Compute, or look up in a table, fibonacci(n-1) and
fibonacci(n-2)
Find the sum of these two numbers
Store the result in a table and return it
Since finding the nth Fibonacci number involves
finding all smaller Fibonacci numbers, the
second recursive call has little work to do
The table may be preserved and used again
later
28. GREEDY ALGORITHMS
An optimization problem is one in which
you want to find, not just a solution, but the
best solution
A “greedy algorithm” sometimes works well
for optimization problems
A greedy algorithm works in phases: At
each phase:
You take the best you can get right now,
without regard for future consequences
You hope that by choosing a local optimum at
each step, you will end up at a global optimum
29. EXAMPLE: COUNTING MONEY
Suppose you want to count out a certain amount of
money, using the fewest possible bills and coins
A greedy algorithm would do this would be:
At each step, take the largest possible bill or coin that
does not overshoot
Example: To make $6.39, you can choose:
a $5 bill
a $1 bill, to make $6
a 25¢ coin, to make $6.25
A 10¢ coin, to make $6.35
four 1¢ coins, to make $6.39
For US money, the greedy algorithm always gives the
optimum solution
30. A FAILURE OF THE GREEDY ALGORITHM
In some (fictional) monetary system,
“krons” come in 1 kron, 7 kron, and 10 kron
coins
Using a greedy algorithm to count out 15
krons, you would get
A 10 kron piece
Five 1 kron pieces, for a total of 15 krons
This requires six coins
A better solution would be to use two 7 kron
pieces and one 1 kron piece
This only requires three coins
The greedy algorithm results in a solution,
but not in an optimal solution
31. BRANCH AND BOUND ALGORITHMS
Branch and bound algorithms are generally used for
optimization problems
As the algorithm progresses, a tree of subproblems is formed
The original problem is considered the “root problem”
A method is used to construct an upper and lower bound for a given
problem
At each node, apply the bounding methods
If the bounds match, it is deemed a feasible solution to that
particular subproblem
If bounds do not match, partition the problem represented by that
node, and make the two subproblems into children nodes
Continue, using the best known feasible solution to trim sections of
the tree, until all nodes have been solved or trimmed
32. EXAMPLE BRANCH AND BOUND ALGORITHM
Travelling salesman problem: A salesman
has to visit each of n cities (at least) once
each, and wants to minimize total distance
travelled
Consider the root problem to be the problem of
finding the shortest route through a set of cities
visiting each city once
Split the node into two child problems:
Shortest route visiting city A first
Shortest route not visiting city A first
Continue subdividing similarly as the tree grows
33. BRUTE FORCE ALGORITHM
A brute force algorithm simply tries all
possibilities until a satisfactory solution is found
Such an algorithm can be:
Optimizing: Find the best solution. This may require finding
all solutions, or if a value for the best solution is known, it
may stop when any best solution is found
Example: Finding the best path for a travelling salesman
Satisficing: Stop as soon as a solution is found that is good
enough
Example: Finding a travelling salesman path that is within 10%
of optimal
34. IMPROVING BRUTE FORCE ALGORITHMS
Often, brute force algorithms require
exponential time
Various heuristics and optimizations can be
used
Heuristic: A “rule of thumb” that helps you decide
which possibilities to look at first
Optimization: In this case, a way to eliminate
certain possibilites without fully exploring them
35. RANDOMIZED ALGORITHMS
A randomized algorithm uses a random
number at least once during the computation
to make a decision
Example: In Quicksort, using a random number
to choose a pivot
Example: Trying to factor a large prime by
choosing random numbers as possible divisors