Posts

Showing posts from August 27, 2017

Time Complexity Analysis

Image
In this post, we will do some excise to understand the actual significance of asymptotic notation. How, we will calculate the complexity and what will be the notations. The following series are important before we can begin to calculate the complexity. Linear series (arithmetic series) for n>=0   Quadratic series for n>=0 Cubic series for n>=0   Geometric series for x!=1,         For |x|<1 nbsp="" span="">  Linear Geometric series for n>=0, real c!=1 Harmonic series nth harmonic number The unrolling of the looping statement within the computer programs may resemble with the following series, and we can directly use it to compute the complexity of the scheme.  How to define notations  Normally, the time complexity with worst case analysis is important If the complexity of  Worst case (Big-O) == Best cast (Big-Omega), than we can go with Average case complexity i.e (Big-theta)  If the loops in the problems are indep

Asymptotic Notations

Image
 In computer science, any problem can be solved using the programming language. And a particular problem can have multiple solutions in terms of Algorithm. To find out which one is the best algorithm for a problem, we analyse it in terms of time and space.  To define the time and space complexity of an algorithm, we use the Asymptotic notation. Mostly three types of Asymptotic notation is widely preferred to represent the complexity of the algorithm. Big-O mathematically represented as O The X-axis of the above graph showing the size of the input (n) and Y axis showing the increase in  time (t) . In the graph,   f(n) function showing the increase of time as input   size   n is increasing for a particular algorithm. Beside, the another function called cg(n) showing the worst case of f(n) . Hence, in the above graph cg(n)  is above the f(n). If we bound the time complexity or f(n) of a given algorithm in terms of input n with another function called cg(n) for all

First Step of Problem Solving Using Data Structure and Algorithm

Image
What is problem ? A state of difficulty that need to be resolve A problem exist and its solution needs to be  attain either correct or incorrect A problem gives an opportunity to improve the current state A problem is a difference between the  current state and goal state Problem Faced in daily life        Like making the decisions what should i wear today to look good? what career? what job? what shoes? what course? What happens when bad decisions are made ? Wastage of time and resource   Six steps to ensure  a Best decision in PROBLEM SOLVING Identify the problem first understand the problem Identify the different way to solve the problem (efficient) Select the best one solution among the various alternative solutions Identify the list of steps to solve a problem (instructions) Evaluate the solution of given problem (different set of inputs) Take the problem of and apply the six step of problem solving     A   Water Jug Pro