This document summarizes the divide and conquer algorithm and provides two examples of problems that can be solved using this approach: closest pair of points and merge sort. For closest pair of points, the problem is divided by splitting the points into two halves, finding the closest pairs in each half recursively, and then merging the results. For merge sort, an array is divided into sub-arrays which are recursively sorted and then merged back together. The document provides pseudocode and Java code to demonstrate implementations of these algorithms using divide and conquer.
Lectures in signals and systems
Engineering + education purpose
This series of lectures was prepared for the third class of both software engineering and network engineering / Aliraqia University/ Baghdad/ Iraq.
In prepared these lectures, I depend on the book “signals and systems” / Simon Haykin, and some of my lectures (4, 6, 8, 10), I depend on some lectures of my professor Dr. Emad Shehab /University of Technology/ Baghdad/ Iraq /
Forgive me for anything wrong by mistake, I wish you can profit from these lectures
My regard
Marwa Moutaz/ M.Sc. studies of Communication Engineering / University of Technology/ Bagdad / Iraq.
Principle of Function Analysis - by Arun Umraossuserd6b1fd
This note explains about functions, type of function, their behaviour, conversion and derivation. This note is best for those who are going to study calculus or phys
Recursion and Problem Solving in Java.
Topics:
Definition and divide-and-conquer strategies
Simple recursive algorithms
Fibonacci numbers
Dicothomic search
X-Expansion
Proposed exercises
Recursive vs Iterative strategies
More complex examples of recursive algorithms
Knight’s Tour
Proposed exercises
Teaching material for the course of "Tecniche di Programmazione" at Politecnico di Torino in year 2012/2013. More information: http://bit.ly/tecn-progr
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...ssuserd6b1fd
Notes for Scilab Programming. This notes includes the mathematics used behind scilab numerical programming. Illustrated with suitable graphics and examples. Each function is explained well with complete example. Helpful to beginners. GUI programming is also explained.
The Lights Out Puzzle and Its VariationsPengfei Li
Analyzed the winning stategy of the famous computer game - Lights Out Puzzle. Almost all the analysis and algorithms are based on basic linear algebra.
This document provides instructions for solving systems of equations using elimination. It demonstrates eliminating variables by adding or subtracting equations. Sample systems are worked through, showing the steps of identifying which variable to eliminate, combining the equations accordingly, solving for one variable, then substituting back into the original equations to solve for the other. The solutions are checked in both equations to verify they satisfy the system.
This document summarizes lecture notes on Lagrange interpolation and Neville's method. It introduces Lagrange interpolation as a method for constructing a polynomial that exactly fits discrete data points. The key steps are: (1) defining Lagrange basis polynomials that are 1 at a data point and 0 at other points, allowing the interpolating polynomial to be written as a linear combination of these basis polynomials and the data values; (2) providing an example of using Lagrange interpolation to find a degree-3 polynomial fitting 4 data points. It then describes Neville's method, which recursively computes interpolating polynomials to allow adding new data points without recomputing everything.
Solution of system of linear equations by eliminationRegie Panganiban
This document describes the elimination method for solving systems of linear equations. It involves eliminating a variable from one equation by making the coefficients of that variable additive inverses. The resulting equation is added to the other equation to solve for the remaining variable. Examples are provided to demonstrate how to set up the equations for elimination and back substitute to solve for both variables. [/SUMMARY]
Lectures in signals and systems
Engineering + education purpose
This series of lectures was prepared for the third class of both software engineering and network engineering / Aliraqia University/ Baghdad/ Iraq.
In prepared these lectures, I depend on the book “signals and systems” / Simon Haykin, and some of my lectures (4, 6, 8, 10), I depend on some lectures of my professor Dr. Emad Shehab /University of Technology/ Baghdad/ Iraq /
Forgive me for anything wrong by mistake, I wish you can profit from these lectures
My regard
Marwa Moutaz/ M.Sc. studies of Communication Engineering / University of Technology/ Bagdad / Iraq.
Principle of Function Analysis - by Arun Umraossuserd6b1fd
This note explains about functions, type of function, their behaviour, conversion and derivation. This note is best for those who are going to study calculus or phys
Recursion and Problem Solving in Java.
Topics:
Definition and divide-and-conquer strategies
Simple recursive algorithms
Fibonacci numbers
Dicothomic search
X-Expansion
Proposed exercises
Recursive vs Iterative strategies
More complex examples of recursive algorithms
Knight’s Tour
Proposed exercises
Teaching material for the course of "Tecniche di Programmazione" at Politecnico di Torino in year 2012/2013. More information: http://bit.ly/tecn-progr
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...ssuserd6b1fd
Notes for Scilab Programming. This notes includes the mathematics used behind scilab numerical programming. Illustrated with suitable graphics and examples. Each function is explained well with complete example. Helpful to beginners. GUI programming is also explained.
The Lights Out Puzzle and Its VariationsPengfei Li
Analyzed the winning stategy of the famous computer game - Lights Out Puzzle. Almost all the analysis and algorithms are based on basic linear algebra.
This document provides instructions for solving systems of equations using elimination. It demonstrates eliminating variables by adding or subtracting equations. Sample systems are worked through, showing the steps of identifying which variable to eliminate, combining the equations accordingly, solving for one variable, then substituting back into the original equations to solve for the other. The solutions are checked in both equations to verify they satisfy the system.
This document summarizes lecture notes on Lagrange interpolation and Neville's method. It introduces Lagrange interpolation as a method for constructing a polynomial that exactly fits discrete data points. The key steps are: (1) defining Lagrange basis polynomials that are 1 at a data point and 0 at other points, allowing the interpolating polynomial to be written as a linear combination of these basis polynomials and the data values; (2) providing an example of using Lagrange interpolation to find a degree-3 polynomial fitting 4 data points. It then describes Neville's method, which recursively computes interpolating polynomials to allow adding new data points without recomputing everything.
Solution of system of linear equations by eliminationRegie Panganiban
This document describes the elimination method for solving systems of linear equations. It involves eliminating a variable from one equation by making the coefficients of that variable additive inverses. The resulting equation is added to the other equation to solve for the remaining variable. Examples are provided to demonstrate how to set up the equations for elimination and back substitute to solve for both variables. [/SUMMARY]
Principle of Integration - Basic Introduction - by Arun Umraossuserd6b1fd
Notes for integral calculus. Students must read function analysis before going through this book. Read Derivative Calculus before going through this book.
This document provides an introduction to complex numbers. It discusses the mathematical and geometrical requirements for representing complex numbers on a plane with real and imaginary axes. Some key points covered include: complex numbers can be used to solve quadratic equations with negative solutions; a complex number has both a real and imaginary part and can be represented as a point in the complex plane; and the angle of a complex number depends on its position in the complex plane relative to the real and imaginary axes. Several examples of representing and calculating angles of complex numbers are worked through.
Limit & Continuity of Functions - Differential Calculus by Arun Umraossuserd6b1fd
This books explains about limits and continuity and is base for derivative calculus. Suitable for CBSE Class XII students who are preparing for IIT JEE.
The document describes three numerical methods for finding the roots or solutions of equations: the bisection method, Newton's method for single variable equations, and Newton's method for systems of nonlinear equations.
The bisection method works by repeatedly bisecting the interval within which a root is known to exist, narrowing in on the root through iterative halving. Newton's method approximates the function with its tangent line to find a better root estimate with each iteration. For systems of equations, Newton's method involves calculating the Jacobian matrix and solving a system of linear equations at each step to update the solution estimate. Examples are provided to illustrate each method.
The document provides steps for solving systems of equations using the elimination method with addition and subtraction:
1. Put both equations in standard form.
2. Determine which variable to eliminate by finding terms with the same coefficients.
3. Add or subtract the equations to eliminate the chosen variable.
4. Substitute and solve for the remaining variable and plug back into one equation to solve for the other.
5. Check the solution by substituting the values back into both original equations.
1. The document outlines the day's math lesson which includes reviewing systems of equations solutions, solving 3x3 systems, and completing yesterday's class work.
2. It provides examples and steps for solving systems of equations by graphing, elimination, and substitution. Equations are presented in standard form and slope-intercept form.
3. Solving 3x3 systems is discussed, noting they cannot be graphed since they exist in three dimensions. The substitution method is demonstrated through an example.
A1, 6 1, solving systems by graphing (blog 1)kstraka
The document defines key terms related to systems of linear equations, including the definition of a system of linear equations as a set of two or more linear equations containing two or more variables. It explains that the solution of a system is an ordered pair that satisfies each equation in the system. Several methods for solving systems are described, including substitution and graphing. Graphing involves setting each equation equal to y and finding the point of intersection of the two lines. Examples are provided to illustrate identifying solutions and solving systems by graphing and checking solutions by substitution.
This document covers systems of linear and nonlinear equations. It discusses various methods for solving systems algebraically, including substitution, elimination, and graphing. It defines the three possible solutions to a system of two linear equations: a unique solution, no solution (inconsistent), or infinitely many solutions (dependent). Examples are provided to illustrate each of these cases and solving systems is applied to real-world word problems. Key concepts covered include linear and nonlinear systems, consistent and inconsistent systems, dependent and independent systems, and various algebraic techniques for solving different types of systems.
Principle of Definite Integra - Integral Calculus - by Arun Umraossuserd6b1fd
Definite integral notes. Best for quick preparation. Easy to understand and colored graphics. Step by step description. Suitable for CBSE board and State Board students in Class XI & XII
Systems of equations by graphing by graphing sect 6 1tty16922
This document provides an overview of solving systems of linear equations by graphing. It begins with examples of identifying whether an ordered pair is a solution to a given system. It then explains that the solution to a system is the point of intersection between the graphs of the two equations. Several examples are worked through of solving systems by graphing and checking solutions by substitution. An example word problem application involves setting up and solving a system to determine the number of nights it will take for two girls reading the same book to reach the same number of pages.
critical points/ stationary points , turning points,Increasing, decreasing functions, absolute maxima & Minima, Local Maxima & Minima , convex upward & convex downward - first & second derivative tests.
The document discusses the elimination method for solving systems of equations. It provides examples of using addition or multiplication to eliminate a variable and obtain a solution. Key steps include adding or multiplying the equations appropriately, substituting values back to solve for the remaining variable, and obtaining the solution point (x,y).
Solving Systems of Equations using Substitution
Step 1) Solve one equation for one variable.
Step 2) Substitute the expression from Step 1 into the other equation.
Step 3) Solve the resulting equation to find the value of the variable. Step 4) Plug this value back into either original equation to find the value of the other variable. Step 5) Check that the solution satisfies both original equations.
15.2 solving systems of equations by substitutionGlenSchlee
This document provides examples for solving systems of linear equations by substitution. It begins with an example showing the step-by-step process for solving a system using substitution. Subsequent examples demonstrate how to solve special systems that have no solution, infinitely many solutions, and systems with fractions or decimals. The final example walks through solving a system with fractions using clear fractions before substitution.
The document defines key terms related to systems of linear equations, including system notation, solution of a system, and methods for determining if an ordered pair is a solution. It provides examples of identifying solutions by substituting values into systems of equations. Graphing methods for solving systems are described, including rewriting equations in slope-intercept form, graphing the lines, and checking the intersection point as the solution.
The document provides steps for solving systems of equations using the elimination method with addition and subtraction:
1) Put both equations in standard form.
2) Determine which variable to eliminate by finding terms with the same coefficients.
3) Add or subtract the equations to eliminate the chosen variable.
4) Substitute values back into one equation to find the other variable.
5) Check that the solution satisfies both original equations.
The document discusses pipeline computing and its various types and applications. It defines pipeline computing as a technique to decompose a sequential process into parallel sub-processes that can execute concurrently. There are two main types - linear and non-linear pipelines. Linear pipelines use a single reservation table while non-linear pipelines use multiple tables. Common applications of pipeline computing include instruction pipelines in CPUs, graphics pipelines in GPUs, software pipelines using pipes, and HTTP pipelining. The document also discusses implementations of pipeline computing and its advantages like reduced cycle time and increased instruction throughput.
This document provides an overview of ergonomics and conducting ergonomic assessments. It begins by outlining the course objectives which are to understand the influences of the work environment, the connection between work activities and repetitive strain, and methods to identify hazards and involve workers. It then briefly discusses the history and definition of ergonomics. The remainder covers components of work, common risk factors, terminology, injuries, the evaluation process, analysis methods like the NIOSH lifting equation, and assessing office workstations. The goal is to leave participants understanding how to analyze jobs for risk factors and make improvements.
I am an algorithm - workshop on understanding bias in codingAcuity Design
Slides from 2 hour workshop on understanding what algorithms are, how they are made, why there are problems, how you can audit them and how to live with them.
This document provides tips for having a positive interviewing experience. It recommends preparing your outfit in advance, getting good rest the night before, planning your route to ensure you are not late, and practicing common interview questions. During the interview, it advises dressing appropriately, being prepared to discuss your resume, building rapport with the interviewer, avoiding cluelessness or nervousness, keeping phones off, and explaining how your skills match the job. After the interview, it suggests shaking the interviewer's hand and thanking them for their time.
The document discusses digital transmission fundamentals, including:
- Digital representation of analog signals involves sampling, quantization, and pulse code modulation.
- The sampling rate must be at least twice the bandwidth of the signal to allow perfect reconstruction.
- Quantization maps samples to discrete levels, introducing quantization error. More levels reduce error but increase transmission bandwidth needs.
- Digital transmission enables long distance communication by regeneration of the digital signal rather than analog amplification, overcoming distance limitations of analog systems.
Principle of Integration - Basic Introduction - by Arun Umraossuserd6b1fd
Notes for integral calculus. Students must read function analysis before going through this book. Read Derivative Calculus before going through this book.
This document provides an introduction to complex numbers. It discusses the mathematical and geometrical requirements for representing complex numbers on a plane with real and imaginary axes. Some key points covered include: complex numbers can be used to solve quadratic equations with negative solutions; a complex number has both a real and imaginary part and can be represented as a point in the complex plane; and the angle of a complex number depends on its position in the complex plane relative to the real and imaginary axes. Several examples of representing and calculating angles of complex numbers are worked through.
Limit & Continuity of Functions - Differential Calculus by Arun Umraossuserd6b1fd
This books explains about limits and continuity and is base for derivative calculus. Suitable for CBSE Class XII students who are preparing for IIT JEE.
The document describes three numerical methods for finding the roots or solutions of equations: the bisection method, Newton's method for single variable equations, and Newton's method for systems of nonlinear equations.
The bisection method works by repeatedly bisecting the interval within which a root is known to exist, narrowing in on the root through iterative halving. Newton's method approximates the function with its tangent line to find a better root estimate with each iteration. For systems of equations, Newton's method involves calculating the Jacobian matrix and solving a system of linear equations at each step to update the solution estimate. Examples are provided to illustrate each method.
The document provides steps for solving systems of equations using the elimination method with addition and subtraction:
1. Put both equations in standard form.
2. Determine which variable to eliminate by finding terms with the same coefficients.
3. Add or subtract the equations to eliminate the chosen variable.
4. Substitute and solve for the remaining variable and plug back into one equation to solve for the other.
5. Check the solution by substituting the values back into both original equations.
1. The document outlines the day's math lesson which includes reviewing systems of equations solutions, solving 3x3 systems, and completing yesterday's class work.
2. It provides examples and steps for solving systems of equations by graphing, elimination, and substitution. Equations are presented in standard form and slope-intercept form.
3. Solving 3x3 systems is discussed, noting they cannot be graphed since they exist in three dimensions. The substitution method is demonstrated through an example.
A1, 6 1, solving systems by graphing (blog 1)kstraka
The document defines key terms related to systems of linear equations, including the definition of a system of linear equations as a set of two or more linear equations containing two or more variables. It explains that the solution of a system is an ordered pair that satisfies each equation in the system. Several methods for solving systems are described, including substitution and graphing. Graphing involves setting each equation equal to y and finding the point of intersection of the two lines. Examples are provided to illustrate identifying solutions and solving systems by graphing and checking solutions by substitution.
This document covers systems of linear and nonlinear equations. It discusses various methods for solving systems algebraically, including substitution, elimination, and graphing. It defines the three possible solutions to a system of two linear equations: a unique solution, no solution (inconsistent), or infinitely many solutions (dependent). Examples are provided to illustrate each of these cases and solving systems is applied to real-world word problems. Key concepts covered include linear and nonlinear systems, consistent and inconsistent systems, dependent and independent systems, and various algebraic techniques for solving different types of systems.
Principle of Definite Integra - Integral Calculus - by Arun Umraossuserd6b1fd
Definite integral notes. Best for quick preparation. Easy to understand and colored graphics. Step by step description. Suitable for CBSE board and State Board students in Class XI & XII
Systems of equations by graphing by graphing sect 6 1tty16922
This document provides an overview of solving systems of linear equations by graphing. It begins with examples of identifying whether an ordered pair is a solution to a given system. It then explains that the solution to a system is the point of intersection between the graphs of the two equations. Several examples are worked through of solving systems by graphing and checking solutions by substitution. An example word problem application involves setting up and solving a system to determine the number of nights it will take for two girls reading the same book to reach the same number of pages.
critical points/ stationary points , turning points,Increasing, decreasing functions, absolute maxima & Minima, Local Maxima & Minima , convex upward & convex downward - first & second derivative tests.
The document discusses the elimination method for solving systems of equations. It provides examples of using addition or multiplication to eliminate a variable and obtain a solution. Key steps include adding or multiplying the equations appropriately, substituting values back to solve for the remaining variable, and obtaining the solution point (x,y).
Solving Systems of Equations using Substitution
Step 1) Solve one equation for one variable.
Step 2) Substitute the expression from Step 1 into the other equation.
Step 3) Solve the resulting equation to find the value of the variable. Step 4) Plug this value back into either original equation to find the value of the other variable. Step 5) Check that the solution satisfies both original equations.
15.2 solving systems of equations by substitutionGlenSchlee
This document provides examples for solving systems of linear equations by substitution. It begins with an example showing the step-by-step process for solving a system using substitution. Subsequent examples demonstrate how to solve special systems that have no solution, infinitely many solutions, and systems with fractions or decimals. The final example walks through solving a system with fractions using clear fractions before substitution.
The document defines key terms related to systems of linear equations, including system notation, solution of a system, and methods for determining if an ordered pair is a solution. It provides examples of identifying solutions by substituting values into systems of equations. Graphing methods for solving systems are described, including rewriting equations in slope-intercept form, graphing the lines, and checking the intersection point as the solution.
The document provides steps for solving systems of equations using the elimination method with addition and subtraction:
1) Put both equations in standard form.
2) Determine which variable to eliminate by finding terms with the same coefficients.
3) Add or subtract the equations to eliminate the chosen variable.
4) Substitute values back into one equation to find the other variable.
5) Check that the solution satisfies both original equations.
The document discusses pipeline computing and its various types and applications. It defines pipeline computing as a technique to decompose a sequential process into parallel sub-processes that can execute concurrently. There are two main types - linear and non-linear pipelines. Linear pipelines use a single reservation table while non-linear pipelines use multiple tables. Common applications of pipeline computing include instruction pipelines in CPUs, graphics pipelines in GPUs, software pipelines using pipes, and HTTP pipelining. The document also discusses implementations of pipeline computing and its advantages like reduced cycle time and increased instruction throughput.
This document provides an overview of ergonomics and conducting ergonomic assessments. It begins by outlining the course objectives which are to understand the influences of the work environment, the connection between work activities and repetitive strain, and methods to identify hazards and involve workers. It then briefly discusses the history and definition of ergonomics. The remainder covers components of work, common risk factors, terminology, injuries, the evaluation process, analysis methods like the NIOSH lifting equation, and assessing office workstations. The goal is to leave participants understanding how to analyze jobs for risk factors and make improvements.
I am an algorithm - workshop on understanding bias in codingAcuity Design
Slides from 2 hour workshop on understanding what algorithms are, how they are made, why there are problems, how you can audit them and how to live with them.
This document provides tips for having a positive interviewing experience. It recommends preparing your outfit in advance, getting good rest the night before, planning your route to ensure you are not late, and practicing common interview questions. During the interview, it advises dressing appropriately, being prepared to discuss your resume, building rapport with the interviewer, avoiding cluelessness or nervousness, keeping phones off, and explaining how your skills match the job. After the interview, it suggests shaking the interviewer's hand and thanking them for their time.
The document discusses digital transmission fundamentals, including:
- Digital representation of analog signals involves sampling, quantization, and pulse code modulation.
- The sampling rate must be at least twice the bandwidth of the signal to allow perfect reconstruction.
- Quantization maps samples to discrete levels, introducing quantization error. More levels reduce error but increase transmission bandwidth needs.
- Digital transmission enables long distance communication by regeneration of the digital signal rather than analog amplification, overcoming distance limitations of analog systems.
The linear search algorithm involves checking all elements of an array or data structure sequentially until the target element is found. In the worst case, all elements must be checked, resulting in O(n) time complexity where n is the number of elements. However, if the target is the first element, it requires only constant O(1) time. The algorithm is simple to implement but does not scale well to large data sets as the search time grows linearly with the number of elements.
Network components include nodes, links, clients, servers, and other devices that connect and allow communication between systems. Key components discussed include network interface cards, hubs, bridges, routers, switches, gateways, and wireless devices. Various media are used to physically transmit data between nodes on a network.
This document provides an overview of computer programming concepts including:
- The relevance of computer programming is to automate tasks done by humans like generating reports and handling bulk data.
- A computer program is a series of instructions written in a programming language like machine language or a high-level language to accomplish a task. Programs must be translated into machine language before execution.
- Key elements of a program include variables to store data, decisions to control flow, and loops to repeat instructions. Functions are small subprograms that perform tasks. Debugging fixes mistakes by trying programs incrementally.
This document discusses algorithms for finding minimum and maximum elements in an array, including simultaneous minimum and maximum algorithms. It introduces dynamic programming as a technique for improving inefficient divide-and-conquer algorithms by storing results of subproblems to avoid recomputing them. Examples of dynamic programming include calculating the Fibonacci sequence and solving an assembly line scheduling problem to minimize total time.
This document discusses dynamic programming and algorithms for solving all-pair shortest path problems. It begins by defining dynamic programming as avoiding recalculating solutions by storing results in a table. It then describes Floyd's algorithm for finding shortest paths between all pairs of nodes in a graph. The algorithm iterates through nodes, calculating shortest paths that pass through each intermediate node. It takes O(n3) time for a graph with n nodes. Finally, it discusses the multistage graph problem and provides forward and backward algorithms to find the minimum cost path from source to destination in a multistage graph in O(V+E) time, where V and E are the numbers of vertices and edges.
The document describes the syllabus for a course on design analysis and algorithms. It covers topics like asymptotic notations, time and space complexities, sorting algorithms, greedy methods, dynamic programming, backtracking, and NP-complete problems. It also provides examples of algorithms like computing greatest common divisor, Sieve of Eratosthenes for primes, and discusses pseudocode conventions. Recursive algorithms and examples like Towers of Hanoi and permutation generation are explained. Finally, it outlines the steps for designing algorithms like understanding the problem, choosing appropriate data structures and computational devices.
1) The document describes the divide-and-conquer algorithm design paradigm. It can be applied to problems where the input can be divided into smaller subproblems, the subproblems can be solved independently, and the solutions combined to solve the original problem.
2) Binary search is provided as an example divide-and-conquer algorithm. It works by recursively dividing the search space in half and only searching the subspace containing the target value.
3) Finding the maximum and minimum elements in an array is also solved using divide-and-conquer. The array is divided into two halves, the max/min found for each subarray, and the overall max/min determined by comparing the subsolutions.
1) The document describes the divide-and-conquer algorithm design paradigm. It splits problems into smaller subproblems, solves the subproblems recursively, and then combines the solutions to solve the original problem.
2) Binary search is provided as an example algorithm that uses divide-and-conquer. It divides the search space in half at each step to quickly determine if an element is present.
3) Finding the maximum and minimum elements in an array is another problem solved using divide-and-conquer. It recursively finds the max and min of halves of the array and combines the results.
This document presents an internship project report on multistep methods for solving initial value problems of ordinary differential equations. It introduces the basic problem of finding the function y(t) that satisfies a given differential equation and initial condition. It discusses existence and uniqueness theorems, Picard's method of successive approximations, and approaches for approximating the required integrations, including the derivative, Taylor series, and Euler's methods. The report appears to evaluate various one-step and multistep numerical methods for solving initial value problems, including Runge-Kutta, Adams-Bashforth, and Adams-Moulton methods.
This document provides an introduction to integration, which is the inverse process of differentiation. It defines indefinite and definite integrals, and discusses techniques for evaluating integrals such as basic integral formulas, integration by parts, integration by substitution, and integrals of trigonometric functions. Examples are provided to illustrate each technique, with practice exercises included at the end. The document serves as a tutorial on basic concepts and methods in integral calculus.
dynamic programming complete by Mumtaz Ali (03154103173)Mumtaz Ali
The document discusses dynamic programming, including its meaning, definition, uses, techniques, and examples. Dynamic programming refers to breaking large problems down into smaller subproblems, solving each subproblem only once, and storing the results for future use. This avoids recomputing the same subproblems repeatedly. Examples covered include matrix chain multiplication, the Fibonacci sequence, and optimal substructure. The document provides details on formulating and solving dynamic programming problems through recursive definitions and storing results in tables.
The document discusses various time complexities of programming constructs like for loops, nested for loops, and inserting elements into data structures like lists and binary trees. It provides examples to explain concepts like big O notation, logarithmic time, and quadratic time complexity. Dynamic programming and backtracking algorithms are introduced as approaches to solve problems optimally with examples for the subset sum problem.
The document discusses recursion, which is a method for solving problems by breaking them down into smaller subproblems. It provides examples of recursive algorithms like summing a list of numbers, calculating factorials, and the Fibonacci sequence. It also covers recursive algorithm components like the base case and recursive call. Methods for analyzing recursive algorithms' running times are presented, including iteration, recursion trees, and the master theorem.
The document discusses divide and conquer algorithms. It explains that divide and conquer algorithms work by dividing problems into smaller subproblems, solving the subproblems independently, and then combining the solutions to solve the original problem. An example of finding the minimum and maximum elements in an array using divide and conquer is provided, with pseudocode. Advantages of divide and conquer algorithms include solving difficult problems and often finding efficient solutions.
The document discusses a blog that provides free solutions manuals and solved exercises for many university textbooks. It states that the solutions manuals contain clear explanations of all the exercises from the textbooks. It invites the reader to visit the blog to download the solutions manuals for free.
Opening of our Deep Learning Lunch & Learn series. First session: introduction to Neural Networks, Gradient descent and backpropagation, by Pablo J. Villacorta, with a prologue by Fernando Velasco
The document provides sample C programs and algorithms to practice implementing functions. It includes 10 programs with increasing complexity: (1) a function to check if a number is prime; (2) a function to validate a date; (3) a function to determine the relative position of a point to a circle; (4) a function to calculate the factorial of a number; (5) a function to calculate the nth Fibonacci number; (6) a function to check if a number is a Fibonacci element; (7) a function to calculate the sum of digits of a number; (8) a function to convert an integer and fraction to a double; (9) functions to calculate the greatest common divisor and least common
This document discusses dynamic programming and algorithms for solving all-pair shortest path problems. It begins by explaining dynamic programming as an optimization technique that works bottom-up by solving subproblems once and storing their solutions, rather than recomputing them. It then presents Floyd's algorithm for finding shortest paths between all pairs of nodes in a graph. The algorithm iterates through nodes, updating the shortest path lengths between all pairs that include that node by exploring paths through it. Finally, it discusses solving multistage graph problems using forward and backward methods that work through the graph stages in different orders.
CALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docxRAHUL126667
CALIFORNIA STATE UNIVERSITY, NORTHRIDGE
MECHANICAL ENGINEERING DEPARTMENT
MARCH 30 2015
ME 309
HOMEWORK #3
Ahmed Mohammed
Problem statement
1. Write a general computer code to solve system of up to five couples first order initial value problems using Heun and Newton iteration trapezoidal methods. These are combined in the same algor4thim in such way that Heun’s method is automatically employed to provide the initial guess at each time step for the Newton iteration required by fully implicit Heun’s method, and no iterations are needed. The complete pseudo-language algorithm is attached.
Test this code by solving the following problem.
Use step size h= 0.1, 0.05 and 0.025. Solve the problem first with explicit Hun’s method, and then with implicit Newton iteration integration for each value of h. employ a convergence tolerance E= 0.000001 for the Newton iteration of the trapezoidal method. The exact solution to this problem is,
Make a table of results of convergence tests (based on the exact solution) at t=1, 2, 3, 4 & 6. This table should include the exact value, the computed solution, the error and the error ratios from successive step size for each of the required values of t. discuss how these results compare with theory. Also discuss what factors should influence the choice of convergence tolerance E for the Newton iterations, and whether the specified value given above is appropriate.
2. Solve the following problem using only the newton iteration trapezoidal method.
Employ step size h=0.1, 0.05, 0.01 and iteration convergence tolerance E= 0.000001. Consider the h=0.01 solution to be the “exact” in order to carry out convergence testes between the h= 0.1 and h=0.05 solutions at t=0.5, 1, 1.5, 2. Make a table, similar to the table in problem number 1.
Mathematical Description
HEUN’S METHOD
Heun’s Method, explained in a short manner, uses the line tangent to the function at the beginning of an interval. Now if a small step is applied to it, the error with the function result will be small. Heun’s method can be explained in more detailed in the following way:
2.-
To obtain solution point (t1,y1) we can use the fundamental theorem of calculus and integrate y’(t) over [t0,t1] to get
3.- Solving for y(t1) we find,
4.- We can use a numerical integration to approximate definite integral. If we use trapezoidal rule with step size h = t1 – t0, then we get
5.- We still need to find, y(t1) but an estimation for this value will work. After this we get the following, which is the Heun’s method.
6.- When this process is repeated it generates a sequence of points that approximate the solution curve y =y(t). At each step, Euler’s method is used as a prediction then the trapezoidal rule helps to make the correction to obtain the final value. [1]
Newton’s Method
It is way to approximate the roots of an equation by taking out the curve in the equation and then replace with a tangent line. Then, it find ...
The document describes various divide and conquer algorithms including binary search, merge sort, quicksort, and finding maximum and minimum elements. It begins by explaining the general divide and conquer approach of dividing a problem into smaller subproblems, solving the subproblems independently, and combining the solutions. Several examples are then provided with pseudocode and analysis of their divide and conquer implementations. Key algorithms covered in the document include binary search (log n time), merge sort (n log n time), and quicksort (n log n time on average).
The document discusses algorithms and the greedy method. It provides examples of problems that can be solved using greedy algorithms, including job sequencing with deadlines and finding minimum spanning trees. It then provides details of algorithms to solve these problems greedily. The job sequencing algorithm sequences jobs by deadline to maximize total profit. Prim's algorithm is described for finding minimum spanning trees by gradually building up the tree from the minimum cost edge at each step.
The document discusses the greedy method algorithmic approach. It provides an overview of greedy algorithms including that they make locally optimal choices at each step to find a global optimal solution. The document also provides examples of problems that can be solved using greedy methods like job sequencing, the knapsack problem, finding minimum spanning trees, and single source shortest paths. It summarizes control flow and applications of greedy algorithms.
This document provides an introduction to Python programming concepts including basic arithmetic operations, variables, data types, functions, strings, lists, conditional statements, while loops, and for loops. It explains key Python syntax such as operators, comments, functions, indexing lists, conditional checks, and loop structures. Examples are given for basic math calculations, string manipulation, list indexing/modification, conditional logic, and while/for loops. Key terms like integers, floats, booleans, strings, lists, tuples, dictionaries, if/else statements, comparison operators, and loop types are defined.
Similar to A simple study on computer algorithms by S. M. Risalat Hasan Chowdhury (20)
Embedded machine learning-based road conditions and driving behavior monitoringIJECEIAES
Car accident rates have increased in recent years, resulting in losses in human lives, properties, and other financial costs. An embedded machine learning-based system is developed to address this critical issue. The system can monitor road conditions, detect driving patterns, and identify aggressive driving behaviors. The system is based on neural networks trained on a comprehensive dataset of driving events, driving styles, and road conditions. The system effectively detects potential risks and helps mitigate the frequency and impact of accidents. The primary goal is to ensure the safety of drivers and vehicles. Collecting data involved gathering information on three key road events: normal street and normal drive, speed bumps, circular yellow speed bumps, and three aggressive driving actions: sudden start, sudden stop, and sudden entry. The gathered data is processed and analyzed using a machine learning system designed for limited power and memory devices. The developed system resulted in 91.9% accuracy, 93.6% precision, and 92% recall. The achieved inference time on an Arduino Nano 33 BLE Sense with a 32-bit CPU running at 64 MHz is 34 ms and requires 2.6 kB peak RAM and 139.9 kB program flash memory, making it suitable for resource-constrained embedded systems.
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...IJECEIAES
Medical image analysis has witnessed significant advancements with deep learning techniques. In the domain of brain tumor segmentation, the ability to
precisely delineate tumor boundaries from magnetic resonance imaging (MRI)
scans holds profound implications for diagnosis. This study presents an ensemble convolutional neural network (CNN) with transfer learning, integrating
the state-of-the-art Deeplabv3+ architecture with the ResNet18 backbone. The
model is rigorously trained and evaluated, exhibiting remarkable performance
metrics, including an impressive global accuracy of 99.286%, a high-class accuracy of 82.191%, a mean intersection over union (IoU) of 79.900%, a weighted
IoU of 98.620%, and a Boundary F1 (BF) score of 83.303%. Notably, a detailed comparative analysis with existing methods showcases the superiority of
our proposed model. These findings underscore the model’s competence in precise brain tumor localization, underscoring its potential to revolutionize medical
image analysis and enhance healthcare outcomes. This research paves the way
for future exploration and optimization of advanced CNN models in medical
imaging, emphasizing addressing false positives and resource efficiency.
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...IJECEIAES
Climate change's impact on the planet forced the United Nations and governments to promote green energies and electric transportation. The deployments of photovoltaic (PV) and electric vehicle (EV) systems gained stronger momentum due to their numerous advantages over fossil fuel types. The advantages go beyond sustainability to reach financial support and stability. The work in this paper introduces the hybrid system between PV and EV to support industrial and commercial plants. This paper covers the theoretical framework of the proposed hybrid system including the required equation to complete the cost analysis when PV and EV are present. In addition, the proposed design diagram which sets the priorities and requirements of the system is presented. The proposed approach allows setup to advance their power stability, especially during power outages. The presented information supports researchers and plant owners to complete the necessary analysis while promoting the deployment of clean energy. The result of a case study that represents a dairy milk farmer supports the theoretical works and highlights its advanced benefits to existing plants. The short return on investment of the proposed approach supports the paper's novelty approach for the sustainable electrical system. In addition, the proposed system allows for an isolated power setup without the need for a transmission line which enhances the safety of the electrical network
Introduction- e - waste – definition - sources of e-waste– hazardous substances in e-waste - effects of e-waste on environment and human health- need for e-waste management– e-waste handling rules - waste minimization techniques for managing e-waste – recycling of e-waste - disposal treatment methods of e- waste – mechanism of extraction of precious metal from leaching solution-global Scenario of E-waste – E-waste in India- case studies.
Literature Review Basics and Understanding Reference Management.pptxDr Ramhari Poudyal
Three-day training on academic research focuses on analytical tools at United Technical College, supported by the University Grant Commission, Nepal. 24-26 May 2024
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELgerogepatton
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
2. Divide and Conquer
Introduction:
From the beginning of creation, every creation follows its own techniques to do daily works. The techniques are
sometimes called algorithm. Algorithm is a finite set of instructions which accomplishes a particular task. An
algorithm is very effective. A person can make it with the help of a paper and pen only. Divide and Conquer is also
an algorithm to solve many problems. Divide and Conquer algorithm divide a problem into sub-problems which are
similar to the actual problem. After that recursively solve these sub-problems and combining their results. The main
problem can be solved by solving the sub-problems appropriately and combined every result. Divide and Conquer
algorithm has many appealing properties which can match them with the newly modern parallel machines. First one
is, they have much inherent parallelism. While the division step is completed, the sub problems are normally
independent and can be solved in parallel. The recursive structure of the algorithm naturally leads to recursively
generate concurrency. Both the divide and the combine steps can be executed in parallel with divide and combine
steps of other sub-problems. Second one is, divide and conquer programs also have good cache performance in the
machine. While a sub-problem goes in the cache, the program can reuse the cached data until the sub-problem will
have been completely solved or a complete result come out. Divide and conquer programs generally work well with
a well range of cache sizes and at all levels of the memory hierarchy [1]
.
Divide
Solve of
Conquer sub-problem
Combine
Figure: Divide and conquer a problem
In the figure, we divide a problem into two separate sub-problems. The machine solves the sub-problem in a parallel
way and gives individual results from it. After this combine the two results and have a solution of that problem.
We can solve a large problem with the help of this algorithm. And every sub-problem of the large problem can be
solved in parallel way in the machine and we can get a combined result of the large problem from every sub-
problem result.
There are many problems which can be solved with the help of Divide and Conquer algorithm. Two of them are
discussed here-
1. Closest pair of point:
1.1. Introduction:
Closest pair of point problem is a well known computational geometry problem. The problem is to find the smallest
distance between two dots. Given n points and their distances, we have to find the smallest distance among them.
Here is an example
Sub-problem
Problem
Sub-problem
Solution of
Sub-problem
Solution of
Sub-problem
Solution of
problem
3. Figure 1.1: n points and their distances.
Figure shows some points and their distances. The distances are 5, 9, 10, 11, 12, 15…. for the n points. Before
calculating the smallest distance for closest pair of point we have to divide the points into two parts to make easy in
calculation.
Figure 1.2: Divide the points into two parts to make easy in calculation.
Figure shows us two separate parts of the problem. Here we use three steps to solve the problem
1. Divide: Draw a vertical line with n/2 points on each side.
2. Conquer: Find closest pair on each side, the work will do recursively.
3. Combine: Find closest pair points from the two sub-problem solutions [2]
.
Usually, the works is not very easy to find the smallest distance between two points. We have to search the whole
distances of every two pair of points. On the left side there are 6 points, 4 distances and their values are 5,11,12,15.
On the right side there are 7 points, 3 distances and their values are 9, 10, and 15. On left side sub-problem solution
is 5 and on the right side sub-problem solution is 9. Combining 5 and 9, we get the final result and that is 5.
4. Figure 1.3: Closets pair of point are shown in red dots.
Figure shows the smallest distance between two points that is 5 and remarked with red dots. We divide the points in
to two parts to make the solution to be easy. If there are more points, we can divide the whole points in a binary way
(4, 8, 16 etc) for searching the minimum or smallest distance between two points.
1.2. Algorithm:
Procedure findclosest (P, int n)
// n is the number of elements in set P
Set: PLeft, PRight, Pleftmin, Prightmin, Pclosest
if (n £ 3)
return SHORTEST (P)
else
PLeft ¬ { p(1), p(2), …. , p(n/2) }
PRight ¬ { p(n/2 + 1), ……. , p(n) }
Pleftmin ¬ findclosest (PLeft, n/2)
Prightmin ¬ findclosest (PRight, n/2)
Pclosest¬ MERGEPLANES (Pleftmin, Prightmin)
return Pclosest
endif
endprocedure
Procedure MERGEPLANES (P1, P2)
D ¬ MINIMUM (P1, P2)
for (every i in P1)
for every j in P2 such that
xi < xj + D AND (yi +d > yj > yi – d)
if DISTANCE (i, j) < D
return (i, j)
endfor
endfor
endprocedure [3]
1.3. Codes in Java:
import java.util.*;
public class ClosestPair{
private double[][] points;
Point p1, p2;
public static void main(String[] args) {
System.out.println(" ********* Closest pair of points ********* ");
double[][] points = new double[100][10];
for (int i = 0; i < points.length; i++)
{
5. points[i][0] = Math.random() * 10;
points[i][1] = Math.random() * 10;
}
ClosestPair closestPair = new ClosestPair(points);
System.out.println("nThe shortest distance is " +
closestPair.getMinimumDistance());
System.out.print("nThe Closest pair is (" + closestPair.p1.x + ", " +
closestPair.p1.y + ") and ");
System.out.println("(" + closestPair.p2.x + ", " +
closestPair.p2.y + ")");
}
ClosestPair() {
}
public ClosestPair(double[][] points) {
setPoints(points);
}
public void setPoints(double[][] points) {
this.points = points;
}
public double getMinimumDistance() {
Point[] pointsOrderedOnX = new Point[points.length];
for (int i = 0; i < pointsOrderedOnX.length; i++)
pointsOrderedOnX[i] = new Point(points[i][0], points[i][1]);
Arrays.sort(pointsOrderedOnX);
if (checkIdentical(pointsOrderedOnX))
return 0;
Point[] pointsOrderedOnY = pointsOrderedOnX.clone();
Arrays.sort(pointsOrderedOnY, new CompareY());
return distance(pointsOrderedOnX, 0,
pointsOrderedOnX.length - 1, pointsOrderedOnY);
}
public boolean checkIdentical(Point[] pointsOrderedOnX) {
for (int i = 0; i < pointsOrderedOnX.length - 1; i++) {
if (pointsOrderedOnX[i].compareTo(pointsOrderedOnX[i + 1]) == 0) {
p1 = pointsOrderedOnX[i];
p2 = pointsOrderedOnX[i + 1];
return true;
}
}
return false;
}
public double distance(
Point[] pointsOrderedOnX, int low, int high,
Point[] pointsOrderedOnY) {
if (low >= high)
return Double.MAX_VALUE;
else if (low + 1 == high) {
p1 = pointsOrderedOnX[low];
p2 = pointsOrderedOnX[high];
return distance(pointsOrderedOnX[low], pointsOrderedOnX[high]);
}
int mid = (low + high) / 2;
Point[] pointsOrderedOnYL = new Point[mid - low + 1];
Point[] pointsOrderedOnYR = new Point[high - mid];
int j1 = 0; int j2 = 0;
for (int i = 0; i < pointsOrderedOnY.length; i++) {
6. if (pointsOrderedOnY[i].compareTo(pointsOrderedOnX[mid]) <= 0)
pointsOrderedOnYL[j1++] = pointsOrderedOnY[i];
else
pointsOrderedOnYR[j2++] = pointsOrderedOnY[i];
}
double d1 = distance(
pointsOrderedOnX, low, mid, pointsOrderedOnYL);
double d2 = distance(
pointsOrderedOnX, mid + 1, high, pointsOrderedOnYR);
double d = Math.min(d1, d2);
int count = 0;
for (int i = 0; i < pointsOrderedOnYL.length; i++)
if (pointsOrderedOnYL[i].x >= pointsOrderedOnX[mid].x - d)
count++;
Point[] stripL = new Point[count];
count = 0;
for (int i = 0; i < pointsOrderedOnYL.length; i++)
if (pointsOrderedOnYL[i].x >= pointsOrderedOnX[mid].x - d)
stripL[count++] = pointsOrderedOnYL[i];
count = 0;
for (int i = 0; i < pointsOrderedOnYR.length; i++)
if (pointsOrderedOnYR[i].x <= pointsOrderedOnX[mid].x + d)
count++;
Point[] stripR = new Point[count];
count = 0;
for (int i = 0; i < pointsOrderedOnYR.length; i++)
if (pointsOrderedOnYR[i].x <= pointsOrderedOnX[mid].x + d)
stripR[count++] = pointsOrderedOnYR[i];
double d3 = d;
int j = 0;
for (int i = 0; i < stripL.length; i++) {
while (j < stripR.length && stripL[i].y > stripR[j].y + d)
j++;
int k = j;
while (k < stripR.length && stripR[k].y <= stripL[i].y + d) {
if (d3 > distance(stripL[i], stripR[k])) {
d3 = distance(stripL[i], stripR[k]);
p1 = stripL[i];
p2 = stripR[k];
}
k++;
}
}
return Math.min(d, d3);
}
public static double distance(Point p1, Point p2) {
return distance(p1.x, p1.y, p2.x, p2.y);
}
public static double distance(
double x1, double y1, double x2, double y2) {
return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}
static class Point implements Comparable<Point> {
double x;
double y;
Point(double x, double y) {
7. this.x = x;
this.y = y;
}
public int compareTo(Point p2) {
if (this.x < p2.x)
return -1;
else if (this.x == p2.x) {
if (this.y < p2.y)
return -1;
else if (this.y == p2.y)
return 0;
else
return 1;
}
else
return 1;
}
}
static class CompareY implements java.util.Comparator<Point> {
public int compare(Point p1, Point p2) {
if (p1.y < p2.y)
return -1;
else if (p1.y == p2.y) {
if (p1.x < p2.x)
return -1;
else if (p1.x == p2.x)
return 0;
else
return 1;
}
else
return 1;
}
}
} [4]
Output:
1.4. Application:
Closest pair of problem arises in a number of applications. For example: in air-traffic control, in mobile phone
connecting with network tower (BTS) problem etc. Here we discuss about the mobile phone connecting problem.
The Cellular phone or mobile phone uses Global System for Mobile communication (GSM) technique to transfer all
kind of data. The word Cell can be defined as an area of radio coverage from one Base Transceiver Station (BTS)
antenna which is the smallest building block in a mobile network. The GSM is divided into two parts and they are
switching system (SS) and Base Station System (BSS).
8. Mobile phone
Figure 1.4: Cell phone connection with BTS
Abbreviations of the above terms are Authentication Center (AUC), Base Station Controller (BSC), Base
Transceiver Station (BTS), Equipment Identity Register (EIR), Home Location Register (HLR), Mobile Station
(MS), Mobile services Switching Center (MSC), Visitor Location Register (VLR). The figure shows, a mobile or
cell phone is connected with a BTS. If a mobile user wants to call another user within a same city but in a different
area, the BTS transfer the data to MSC trough BSC. MSC is for the same city network providing tool. Another
user’s BSC is also connected with this MSC. So the two users of this network use the same MSC to establish a
phone call or other services. There are many BTSs in an area but the question is which BTS is going to connect with
the Mobile Station (MS). Basically cells are hexagonal. They cover a hexagon network. While a user goes to another
cell it faces some problems. The process of changing a cell during a phone call is called handover. Handover process
maintains the following steps to change a cell. They are-
1. A mobile station continuously measures the signal strength of connected cell and neighboring cells.
2. It sends the message report of measured power level to the BSC.
3. Based on these report BSC decides the importance of handover and channel allocation in new cell.
4. If BSC observes handover is essential then it assigns a new channel in new cell and informs MS to send the
message to this new channel.
5. MS leave the old cell/BTS and establish a new connection with the new cell/BTS.
With this process a cell phone can change its BTS. Now the question is which BTS is going to connect with MS.
The solution is using the technique of “Closest pair of point”. MS will follow the following criteria. One is the
signal strength and second is minimum distance between the MS and BTS. Which BTS has the following two
criteria will connect with the MS and establishes a network.
SS AUC
VLR HLR EIR
GMSC MSCOther Networks
BSS
BSC
BTS
9. Figure 1.5: MS connects with nearest BTS
Figure shows the connection among MS and BTSs. MS trace the distances among the BTSs but it only connects
with the nearest one. There are five BTS near by the MS and the distances are 85 feet, 95 feet, 110 feet, 165 feet and
255 feet. First the MS calculate the distance near to it and it measure all the distances. It checks 85, 95, 110, 165 and
255 in a parallel way and get the solution for which BTS is going to be connected. As we see from the figure, the 85
feet is the solution and the MS is going to connect with this BTS. Generally a cell phone connects with only a BTS.
When a cell phone changes its cell, then the handover process is needed. Cell phone’s data voice goes to the BSC
through the BTS as so MSC. If there is another cell phone user in the same city but different area, it will also use the
same MSC as the previous cell phone user use.
Figure 1.6: A conversation between two cell phone users trough a same MSC.
Figure shows us the view of a conversation between cell phone users in same city. This is what actually happened
when a phone call is being started every time.
1.5. Advantages of closest pair of point:
1. One can use the best path to travel or use.
2. After finding the smallest distance it is easy to travel to the nearest one.
3. The best path or way can save time and money too.
1.6. Disadvantages of closest pair of point:
1. It can waste some time to search the right path or nearest destination or smallest distance.
2. The measuring of smallest distance between source to destination is not easy because we have to measure all the
points or destinations [5]
.
10. 2. Merge sort:
2.1. Introduction:
Merge sort is a technique to sort a series on numbers or a string etc. Merge sort follows Divide and conquer
algorithm to do its task. It was invented by John von Neumann in 1945. Here we are using divide-and-conquer to
sort; we need to decide what our sub-problems will be going to look like. The full problem is to sort the entire array.
The sub-problem is to sort a sub-array.
Figure 4.1: Marge sort.
The figure shows us a normal array which contain {38, 27, 43, 3, 9, 82, 10}. First we divide it into two sub-array,
after that we again divide it. Now the sub-arrays are {38, 27}, {43, 3}, {9, 82} and {10}. Every sub-array will
calculate first and then merge it with its nearest sub-array. Finally we calculate the entire two sub-arrays which are
{3, 27, 38, 43} and {9, 10, 82}. The final merged array is {3, 9, 10, 27, 38, 43, 82}.
2.2. Application:
Merge Sorts are helpful for sorting linked lists in O(n log n) time. In case of linked lists, the case is
different due to difference in memory allocation of arrays and linked lists.
It is used in inversion count problem.
It is used in external sorting [6]
.
2.3. Algorithm:
Algorithm MergeSort(low,high)
//a[low:high] is a global array to be sorted.
//Small(P) is true if there is only one element.
//to sort. In this case list the list is already sorted.
{
if(low < high) then // If there are more than one element.
{
// Divide P into subproblems.
// Find where to split the set.
mid :=[(low+high)/2;
// Solve the subproblems.
MergeSort(low,mid);
MergeSort(mid+ I,high);
// Combinethe solutions.
11. Merge(lowm, id,high);
}
}[7]
.
2.4. Codes in Java:
import java.util.Scanner;
public class MergeSort
{
public static void sort(int[] a, int low, int high)
{
int N = high - low;
if (N <= 1)
return;
int mid = low + N/2;
sort(a, low, mid);
sort(a, mid, high);
int[] temp = new int[N];
int i = low, j = mid;
for (int k = 0; k < N; k++)
{
if (i == mid)
temp[k] = a[j++];
else if (j == high)
temp[k] = a[i++];
else if (a[j]<a[i])
temp[k] = a[j++];
else
temp[k] = a[i++];
}
for (int k = 0; k < N; k++)
a[low + k] = temp[k];
}
public static void main(String[] args)
{
Scanner scan = new Scanner( System.in );
System.out.println("Merge Sort Testn");
int n, i;
System.out.println("Enter number of integer elements");
n = scan.nextInt();
int arr[] = new int[ n ];
System.out.println("nEnter "+ n +" integer elements");
for (i = 0; i < n; i++)
arr[i] = scan.nextInt();
sort(arr, 0, n);
System.out.println("nElements after sorting ");
for (i = 0; i < n; i++)
System.out.print(arr[i]+" ");
System.out.println();
}
12. }
Output:
2.5. Advantages:
It can be applied in any size of files or arrays.
Reading of the input during the run-creation step is sequential.
Since I/O is largely sequential, merge sort can be used.
2.6. Disadvantage:
The disadvantage of merge sort is that it uses a lot of memory.
It uses extra space proportional to n. This may slow it down when trying to sort very large data [8]
.
Conclusion of Divide and conquer:
The Divide and conquer algorithm has many beneficial qualities that makes it a very important algorithm. It follows
only three simple steps to make complex problems easier, and those steps are to:
(1) Divide the complex problem into two or more sub-problems,
(2) Recursively solve the sub problems,
(3) Conquer by combining the solutions from the sub problems to get a solution of the original problem.
It makes us capable to solve difficult problems, helps to find other efficient algorithms and is sometimes the best
choice than other algorithms. One of the only downfalls to this algorithm is the fact that sometimes recursion is
slow, and this fact can almost negate all the other advantages of this process. Merge Sort and Quick Sort are both
sorting algorithms that are based on this process of the divide and conquer algorithm. This basic idea of dividing and
conquering can be seen in everyday life. We can solve our daily problems by it. So, it is efficient and effective
algorithm than others.
13. Dynamic Programming
Introduction:
Dynamic programming is a programming method or technique that uses to solve the recursive problems in more
efficient way or manner. Dynamic programming use Recursive technique (Recursion) .
Dynamic programming recursively solve the sub-problems and store the solutions of the sub-problems this is called
Memorization (i.e. avoid solve the sub-problem again) .
Dynamic programming technique and memorization technique works together. So, we can say, dynamic
programming has two parts:-
Recursion: recursively solve the sub-problems .
Memorization: store the solution of sub-problems i.e. avoid solving the sub-problems that already solved.
Properties of Dynamic programming
Dynamic programming has two major properties:-
Overlapping Sub-problems: Overlapping sub-problem means every sub-problem to be solved again and
again. In dynamic programming, using recursion, we solve those sub-problems only one time and store it
for future use.
Optimal Substructure: If a solution of the sub-problems can be use to solve a problem that is called
Optimal Substructure Property.
Note: If any problem has both properties then we can be apply and solve this problem using dynamic programming
method.
Approaches of Dynamic Programming
Two ways can be achieved Dynamic programming-
Bottom-Up Approach: The solution of first sub-problem can be use to solve the second sub-problem and
the solution of second sub-problem can be use to solve the third sub-problem, following these sequence or
criteria is known as Button-Up approach.
Top-Down Approach: Break the problem into sub-problems and solves them and store the result for future
use. This is the direct fall-out of the recursive formulation of any problem [1].
Complexity of Dynamic Programming
Time Complexity:
Dynamic programming doesn't have a time complexity, because it is not a specific algorithm. It's a general approach
to constructing algorithms to solve problems that have certain properties (namely: optimal
substructure and overlapping sub-problems) [7].
Space Complexity: Dynamic programming uses recursive and memorization so that space complexity will be
occurred.
Example 1
Fibonacci Series or Sequence Using Dynamic Programming.
Introduction: The current number is the sum of previous two numbers i.e. 0 1 1 2 3 5 8 13 . . .[8].
14. Program Flowchart
Figure 1: Flowchart of Fibonacci series or sequence Using Dynamic Programming.
Pseudo code [2].
Main()
{
Declaration & Initialization:
Int n;
Int Fibo[n];
Boolean command = true;
While(command = true ?)
{
Input n;
15. Fibonacci ( n );
Print the result;
Input command = true / false;
}
}
Fibonacci(n)
{
if(n is equal to 0)
fibo[n] = return 0;
if(n is equal to 1)
fibo[n] = return 1;
if(fibo[n-2] is unsolved)
fibo[n-2] = Fibonacci(n-2);
if(fibo[n-1] is unsolved)
fibo[n-1] = Fibonacci(n-1);
fibo[n] = fibo[n-2] + fibo[n-1];
return fibo[n];
}
Code:
import java.util.Scanner;
public class FibonacciSeriesDemo {
static Scanner scanner = new Scanner(System.in);
static boolean command = true;
public static void main(String[] args) {
int n = 0;
Fibonacci fibonacci = new Fibonacci(100);
System.out.println("***Fibonacci Series Using Dynamic Programming****n");
while (command) {
System.out.print("nEnter the n'th position: ");
n = scanner.nextInt();
System.out.println("=>> Fibonacci[" + n + "] = " + fibonacci.fiboSeries(n));
System.out.print("nYou want to exit the programm(y/n): ");
getCommand();
}
System.out.println("nn******Thank You*******");
}
private static void getCommand() {
scanner.nextLine();
if (scanner.nextLine().equalsIgnoreCase("y")) {
command = false;
}
}
}
public class Fibonacci {
int[] f = { 0 };
public Fibonacci(int n) {
f = new int[n];
f[0] = 0;
f[1] = 1;
}
public int fiboSeries(int n) {
if (n == 0) {
return 0;
}
16. if (n == 1) {
return 1;
}
if (f[n - 2] == 0) {
f[n - 2] = fiboSeries(n - 2);
}
if (f[n - 1] == 0) {
f[n - 1] = fiboSeries(n - 1);
}
f[n] = f[n - 2] + f[n - 1];
return f[n];
}
}
Output:
Application:
In computer science:
1. Fibonacci heaps which have better amortized running time than binomial heaps.
2. Fibonacci search which shares O(log N) running time with binary search on an ordered array.
17. Example 2
Maximum Sum of Contiguous Sub-Array Using Dynamic Programming [3].
Introduction: A sub-array has one number of some continuous numbers. Given an integer array with positive
numbers and negative numbers, get the maximum sum of all sub-arrays. Time complexity should be O (n) [9].
For example, in the array {1, -2, 3, 10, -4, 7, 2, -5}, its sub-array {3, 10, -4, 7, 2} has the maximum sum 18 [9].
Program Flowchart:
Figure 2: Flowchart of maximum Sum of Contiguous Sub-Array Using Dynamic Programming.
Pseudo code:
Main()
{
Declaration & Initialization:
Int array[n];
Boolean command = true;
While(command = true ?)
{
For (0 : n)
{
18. Input and store array elements one by one;
}
MSS ( array);
Print the result;
Input command = true / false;
}
}
MSS(array[n])
{
maxSum=subArraySum[i]= array[i]; // where i=0;
for(i=1 : n)
{
subArraySum[i] = Max( array[i], subArraySum[i-1]+array[i] );
maxSum = Max(maxSum,subArraysum[i]);
}
Return maxSum;
}
Code:
import java.util.Scanner;
public class MSSDemo { // MSSDemo.java
static boolean statement = true;
static int array[];
static Scanner sc=new Scanner(System.in);
public static void main(String[] args) {
System.out.println("n=======Welcome to Maximum Sum Of Contiguous Sub-Array Programme========n");
while (statement) {
arrayInitialization();
System.out.println("nnMaximum Sum = "+new MaximumSumOfContiguousSuArray().MSS(array));
getStatement();
}
System.out.println("n======Thank You=======n");
}
static boolean getStatement() {
System.out.print("nYou want to exit the Program(Y/N) . . . ? ");
if ("Y".equalsIgnoreCase(new Scanner(System.in).nextLine())) {
return statement = false;
} else {
return statement = true;
}
}
public static void arrayInitialization(){
System.out.print("Enter Array Limit: ");
array=new int[sc.nextInt()];
System.out.print("nEnter Array Element:- n");
for(int i=0; i<array.length; i++){
System.out.print("nArray["+(i+1)+"] = ");
array[i]=sc.nextInt();
}
}
}
System.out.println("n=======Welcome to Maximum Sum Of Contiguous Sub-Array Programme========n");
19. public class MaximumSumOfContiguousSuArray {
public int MSS(int[] array) {
int subArraySum[] = new int[array.length];
int maxSum = subArraySum[0] = array[0];
for (int i = 1; i < array.length; i++) {
subArraySum[i] = Math.max(array[i], subArraySum[i - 1] + array[i]);
maxSum = Math.max(subArraySum[i], maxSum);
}
return maxSum;
}
}
Output:
20. Example 3
Maximum Sub-Square Matrix of a Matrix using Dynamic Programming [4].
Introduction: Given a matrix of 0’s and 1’s (binary matrix). Find out Maximum size square sub-matrix with all 1’s
[4].
Example:
Figure [3]: Maximum size square sub-matrix with all 1s Example [4].
Pseudo code [4].
Main()
{
Declare matrix[n][m];
For( i=0 : n)
{
For(j=0 : m)
{
Matrix[i][j] = input array element;
}
}
Call MSSM ( matrix );
Print the result;
}
MSSM(matrix)// Maximum Sub-Square Function
{
declare temp[matrixColumn][matrixRow];
for(i=0 : matrixColumn)
{
temp[0][i]=matrix[0][i];
}
for(i=0 : matrixRow)
{
temp[i][0]=matrix[i][0];
}
Max=1;
for(i=0 : matrixRow)
{
for(i=0 : matrixColumn)
{
If(matrix[i][j] equal 0)
{
Continue;
}
temp[i][j] = getMin(temp[i-1][j],temp[i-1][j-1],temp[i][j-1]) + 1;
if(temp[i][j] grater then max)
{
max=temp[i][j];
}
21. }
}
Return max;
}
getMin(a,b,c)// Finding the Minimum Value
{
Declare min;
If(a < b){
Min =a;
}
Else {
Min =b;
}
If(c < min){
Min =c;
}
Return min;
}
Program Flowchart:
Figure 3: Flowchart of Maximum Sub-Square Matrix of matrix.
22. Code:
import java.util.Scanner;
public class MaximumSubSquareMatrix {
public int MSSM(int matrix[][]) {
int temp[][] = new int[matrix.length][matrix[0].length];
for (int j = 0; j < matrix[0].length; j++) {
temp[0][j] = matrix[0][j];
}
for (int i = 0; i < matrix.length; i++) {
temp[i][0] = matrix[i][0];
}
int max = 1;
for (int i = 1; i < matrix.length; i++) {
for (int j = 1; j < matrix[i].length; j++) {
if (matrix[i][j] == 0)
continue;
temp[i][j] = getMin(temp[i - 1][j], temp[i - 1][j - 1], temp[i][j - 1]) + 1;
if (temp[i][j] > max)
max = temp[i][j];
}
}
return max;
}
private int getMin(int a, int b, int c) {
return Math.min(Math.min(a, b), c);
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("===Maximum Sub-Square Matrix Using Dynamic Programming====");
System.out.print("nEnter number of column: ");
int m = sc.nextInt();
System.out.print("Enter number of Row: ");
int n = sc.nextInt();
int matrix[][] = new int[n][m];
System.out.println("nEnter Array Element's :");
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
matrix[i][j] = sc.nextInt();
}
}
MaximumSubSquareMatrix mm = new MaximumSubSquareMatrix();
System.out.println("nnMaximum Sub-Square Matrix is: " + mm.MSSM(matrix));
}
}
24. The Greedy Methods
Huffman coding Algorithm
1.1 Introduction: Huffman coding is one of the most popular technique for removing coding redundancy. It has
been used in various compression applications [1].
The lossless method of compression and decompression is proposed using Huffman coding which is used on test
string as well as on different image file formats for performance analysis. The result reveals that the original image
used for coding is almost close to the decoded output image [1].
Huffman codes are prefix-free codes and decodable, that’s mean no code is the prefix of the some other code and
one can know when the last bit of the code is read and immediately recognize the code[2].
Huffman coding is base on the frequency of occurrence data item. It is used to code values according to their
probability of occurrence. Short words are assigned to highly probable values and long code words to less probable
values.
1.2 Methods:
1. Make a list of the symbols, sorted by frequencies from largest to smallest.
2. Combine the two smallest frequency values.
3. Repeat Steps 1 and 2 until the all of the frequencies have been added up.
The final number at the head of the tree should be the sum of all the frequencies. The path of each symbol’s
frequency is traced from top to the each branch of the tree.
1.3 Constructing tree:
The objective is to construct a tree such that the path from a leaf that contains the symbols s to the root has a length
as close as possible to − log( p(s)). To each leaf is associated a weight, which is basically the number of times the
symbol s has been seen in the data. Huffman algorithm’s strategy is to build a tree with weights that are as balanced
as possible.
The unusual thing is in Huffman’s algorithm is that instead of building this tree from the root down to the leaf, it is
built from the leaves up to the root. The first step is to build a list which contains only leaves. Each leaf has an
associated symbol s and a weight, p(s). We pick, out of that list, the two element with the smallest weights. We
create a new node such that its children are the two picks, and that its weight is the sum of its children’s weight. We
put back the new node in the list. We repeat this procedure until only one node is left, which will become the root of
the tree. Codes are then assigned easily. Each time we go left in the tree, we assign a ‘0’, and when we go right, we
assign a ‘1’. The code for a leaf is the path one must follow to reach it from the root.
1.4 Example: We use this sentence for the below figure "this is an example of a huffman tree".
25. Fig 1: Huffman tree
[Source: https://www.google.com.bd/search?q=huffman+coding+algorithm]
Figure description: In the above figure, we construct a huffman tree using the sentence "this is an example of a
huffman tree ".At first we calculate the frequency of the characters. Then we sorted them as decreasing order. After
that we combine two minimum values. Using this technique we find the root. Here is the root is 36. Each time we go
left in the tree, we assign a ‘0’, and when we go right, we assign a ‘1’.
1.5 Algorithm:
1. n=|C|
2. Q=C
3. For i=1 to n-1
4. Allocate a new node z
5. z.left=x=EXTRACT-MIN(Q)
6. z.right=y= EXTRACT-MIN(Q)
7. z.freq=x.freq+y.freq
8. INSERT(Q,z)
9. Return EXTRACT-MIN(Q) //return the root of the tree
1.6 Code:
import java.util.*;
abstract class HuffmanTree implements Comparable<HuffmanTree> {
public final int frequency; // the frequency of this tree
public HuffmanTree(int freq) { frequency = freq; }
// compares on the frequency
public int compareTo(HuffmanTree tree) {
return frequency - tree.frequency;
26. }
}
class HuffmanLeaf extends HuffmanTree {
public final char value; // the character this leaf represents
public HuffmanLeaf(int freq, char val) {
super(freq);
value = val;
}
}
class HuffmanNode extends HuffmanTree {
public final HuffmanTree left, right; // subtrees
public HuffmanNode(HuffmanTree l, HuffmanTree r) {
super(l.frequency + r.frequency);
left = l;
right = r;
}
}
public class HuffmanCode2 {
// input is an array of frequencies, indexed by character code
public static HuffmanTree buildTree(int[] charFreqs) {
PriorityQueue<HuffmanTree> trees = new PriorityQueue<HuffmanTree>();
// initially, we have a forest of leaves
// one for each non-empty character
for (int i = 0; i < charFreqs.length; i++)
if (charFreqs[i] > 0)
trees.offer(new HuffmanLeaf(charFreqs[i], (char)i));
assert trees.size() > 0;
// loop until there is only one tree left
while (trees.size() > 1) {
// two trees with least frequency
HuffmanTree a = trees.poll();
HuffmanTree b = trees.poll();
// put into new node and re-insert into queue
trees.offer(new HuffmanNode(a, b));
}
return trees.poll();
}
27. public static void printCodes(HuffmanTree tree, StringBuffer prefix) {
assert tree != null;
if (tree instanceof HuffmanLeaf) {
HuffmanLeaf leaf = (HuffmanLeaf)tree;
// print out character, frequency, and code for this leaf (which is just the prefix)
System.out.println(leaf.value + "t" + leaf.frequency + "t" + prefix);
} else if (tree instanceof HuffmanNode) {
HuffmanNode node = (HuffmanNode)tree;
// traverse left
prefix.append('0');
printCodes(node.left, prefix);
prefix.deleteCharAt(prefix.length()-1);
// traverse right
prefix.append('1');
printCodes(node.right, prefix);
prefix.deleteCharAt(prefix.length()-1);
}
}
public static void main(String[] args) {
String test = "this is an example for huffman encoding";
// we will assume that all our characters will have
// code less than 256, for simplicity
int[] charFreqs = new int[256];
System.out.println("################HUFFMAN CODING ALGORITHM###########");
// read each character and record the frequencies
for (char c : test.toCharArray())
charFreqs[c]++;
// build tree
HuffmanTree tree = buildTree(charFreqs);
// print out results
System.out.println("SYMBOLtWEIGHTtHUFFMAN CODE");
printCodes(tree, new StringBuffer());
}
}
1.7 Application:
1. It is used for image detect
2. data compression
28. 3. pattern matching
1.8 Strength:
1. It needs less time to transmit data.
2. It needs less memory space after encoding the data.
3. It is very efficient technique.
4. Huffman is a good coding technique for compressing the data and general types of images.
1.9 Limitation:
1. It is used static coding.
2. The algorithm must see all the data before performing the compression. It is quite impractical to do so. One
might not have the sufficient space to store all the data before starting compression.
3. It needs very large memory.
4. In the ‘worst case’, the code book cannot consist more than 256 possible bytes. But in the real world, one might
need a code book for a set of several thousands or millions symbols.
5. To understand the compressed data by the decoder, the decoder must know the code book. If the decoders don’t
know the code book then one will transmit the code book by itself. By doing this, the data might be losing
completely[2].
6. It needs very large code book for large symbols.
1.10 Conclusion:
From the above discussion we have seen that the original image used for coding is almost close to the decoded
output image. The result shows that the higher Code redundancy helps to achieve more compression. The above
presented Huffman coding and decoding is used to reduce test data volume, test data compression and
decompression time. Hence we conclude that Huffman coding is efficient technique for image compression and
decompression to some extent.
The problems of adaptivity, memory management and code book transmission problems, we propose a new
algorithm for adaptive Huffman coding. The algorithm allows for very good adaptivity, efficient memory usage and
efficient decoding algorithms.
29. Dijkstra's Algorithm
2.1 Introduction: It is an algorithm for finding the shortest path between nodes in a graph. The algorithm is divided
into two categories. One is single source to single destination, and another is single source to multiple destinations in
the graph.For example, if the nodes are representing cities and edge represent distances between pairs of cities,
Dijkstra's algorithm can be used to find the shortest route between one city and all other cities. As a result, the
shortest path algorithm is widely used in network routing protocols. We are starting from the source node or initial
node. We have to find the shortest path from source to destination node. We use some steps to find the shortest path.
Which are given bellow:
1. Set zero to initial node and infinity for all other nodes.
2. Set the initial node as current node. Mark all the nodes as unvisited. Create a set of all the unvisited nodes
as a set of unvisited set.
3. For the current node calculates the distances of unvisited neighbors. Compare the newly calculated distance
to the current assigned value and assign the smaller one.
4. When we are visited all of the neighbors of the current node, mark the current node as visited and remove it
from the unvisited set. A visited node will never check again.
5. If the destination node has been marked visited. Then the algorithm has finished.
2.2 Example:
Fig 3: Dijkstra's algorithm
From the figure ,u is the source and z is the destination, we have to reach the destination z from u using
shortest path, at first we go to v and cost is 2,we can go to the node x is cost is 1,and we can go to node w
,whose cost is 5.we can use node v to go to node w and node x whose cost is 5 and 4 respectively. But we
can go node w and x directly whose cost is 5 and 1 respectively, which is optimal from previous step. So
node v is eliminated. We can go to node w via node x , whose cost is 4 ,it is optimal than direct edge u to
w. From x we can go to node y, whose cost is 2 from source. We can go to node w via y whose cost is 3
from source which is better than previous cost from source via x. from node w we go to node z whose cost
is 8 and from via node y to node z cost is 3. So it is the optimal solution, now the shortest path is u to x and
x to y and y to z. The cost is 3.
30. 2.3 Algorithm:
1. INITIALIZE-SINGLE-SOURCE(G,s)
2. S=∅
3. Q=G.V
4. While Q≠ ∅
5. U=EXTRACT-MIN(Q)
6. S=S U {u}
7. For each vertex v ∈ G.Adj[u]
8. RELAX(u,v,w)
2.4 Code:
import java.util.*;
public class Dijkstra
{
public static void main(String args[])
{
System.out.println("************** Dijkstra's Algorithm **************n");
Scanner input=new Scanner(System.in);//Scanner
int vertex,noOfEdges=1,min=999,u=0,v=0,total=0,i,j;//initialization
System.out.print("Enter the number of vertex: ");
vertex=input.nextInt();//take input no. of vertex
int matrix[][]=new int[vertex][vertex],visited[]=new int[vertex];//initialization
//input matrix
System.out.println("Enter the values of adjacent matrix :");
for(i=0;i<vertex;i++)
{
visited[i]=0;//make all the vettexes are not visited
for(j=0;j<vertex;j++)
{
matrix[i][j]=input.nextInt();//take value of adjacent matrix
if(matrix[i][j]==0)//true if vertexes are not related
{
matrix[i][j]=999;//which vertexes are not related make the
distance 999 as like infinite between them
}
}
}
32. System.out.println("nnThe cost of the minimum shortest path is = "+total);
}
}
2.5 Application:
1. Robot path planning.
2. Logistics Distribution Lines.
3. Link-state routing protocols.
4. OSPF(Open Shortest Path First)
5. IS-IS (Intermediate System to Intermediate System)
2.6 Advantage:
1. It is faster.
2. It doesn’t need to investigate all the edges.
3. It is not restricted to acyclic graph.
4. It is very efficient.
2.7 Disadvantage:
1. Expensive to compute.
2. The major disadvantage of the algorithm is the fact that it does a blind search there by consuming a lot of
time waste of necessary resources.
3. It cannot handle negative edges. This leads to acyclic graphs and most often cannot obtain the right shortest
path.
2.8 Conclusion:
From the above discussion we have seen that it is very simple algorithm to find the shortest path from
source to destination. It is very efficient and effective algorithm. We use prim’s algorithm to solve the
problem.
33. Contribution:
Divide and conquer algorithm – S. M. Risalat Hasan Chowdhury.
Dynamic Programming – Sumon Badaya.
Greedy Method – Nayeem Sagor.
References for Divide and Conquer:
1. Radu Rugina and Martin Rinard, Laboratory for Computer Science Massachusetts Institute of Technology
Cambridge, MA 02139.
2. Paul Beame and others.
3. Ashish Sharma,Rengakrishnan Subramanian,November 28, 2001.
4. http://www.ecs.csun.edu/~cputnam/Comp%20110/Liang%208th%20ed%20PP_Slides/html/ClosestPair.ht
ml
5. GSM System Survey-1 by Ericsson.
6. http://quiz.geeksforgeeks.org/merge-sort/
7. Fundamentals of Computer Algorithms by Sartaj Sahni, Ellis Horowitz and Sanguthevar Rajasekaran.
8. http://www.answers.com/Q/What_are_the_advantages_and_disadvantages_of_merge_sort#slide=5
References for Dynamic Programming:
1. http://algorithms.tutorialhorizon.com/introduction-to-dynamic-programming.
2. http://algorithms.tutorialhorizon.com/introduction-to-dynamic-programming-fibonacci-series/
3. http://www.geeksforgeeks.org/largest-sum-contiguous-subarray/
4. http://algorithms.tutorialhorizon.com/dynamic-programming-maximum-size-square-sub-matrix-with-all-1s/
5. https://github.com/mission-peace/interview/wiki/Dynamic-Programming/
6. https://github.com/mission-peace/interview/wiki/Dynamic-Programming/
7. https://www.quora.com/What-is-the-time-complexity-of-dynamic-programming
8. http://stackoverflow.com/questions/4571670/why-are-fibonacci-numbers-significant-in-computer-science
9. http://codercareer.blogspot.com/p/dynamic-interview-questions.html
References for Greedy Method:
1. Aarti, “Performance Analysis of Huffman Coding Algorithm”, International Journal of Advanced
Research in Computer Science and Software Engineering, Volume 3, Issue 5, May 2013.
2. Steven Pigeon, Yoshua Bengio, “A Memory-Efficient Huffman Adaptive Coding Algorithm for Very
Large Sets of Symbols”
3. http://www.geeksforgeeks.org/greedy-algorithms-set-1-activity-selection-problem/