Skip to main content

Afiiliate Program

 1. Amazon Afiiliate Link  https://amzn.to/3wZR1pz  https://amzn.to/3x5KGt3 The Amazon Affiliate program, also called "Amazon Associates," can be an easy way to monetize your website or blog. Simply sign up, receive immediate approval, and place Amazon affiliate links on your site. When someone makes an Amazon purchase via one of your links, you get the commission — it's that simple. 2. Flipkart Affiliate Link https://www.flipkart.com/?affid=vatsalgup2

Divide and Conquer

Divide and Conquer


Divide and conquer is an algorithm pattern. In algorithm methods, the design is to take a dispute on a huge input, break the input into minor pieces,decide the problem on each of the small pieces, and then merge the piecewise solutions into a global solution. This mechanism of solving the problem is called the Divide & Conquer Strategy.


Divide and Conquer algorithm consists of a dispute using the following three steps:


Divide: The original problem into a set of subproblems.

Conquer: Solve every sub problem individually recursively.

Combine: Put together the solutions of the subproblem to get the solution to the whole problem.



Some Examples of Divide & Conquer Algorithms are:

  • Quick Sort 

  • Merge Sort

  • Binary Search


Algorithm of Divide & Conquer 


function DAndC(P){

if(small(p)then

return S(p)

else 

divide the problem p into p1,p2,_ _ _

solve the problem p1,p2,_ _ pk ny recursive calling of DAndC

}

        return(DAndC(p1),DAndC(p2)_ _ _ _ DAndC(pk))



Comments

Popular posts from this blog

What is Algorithm

  Algorithm A finite set of instructions that specifies a sequence of operation is to be carried out in order to solve a specific problem or class of problems is called an Algorithm. An algorithm can be defined as a well-defined computational procedure that takes some values or the set of values, as an input and produces some value, or the set of values, as an output. An algorithm is thus a sequence of computational steps that transform the input into output. It describes the specific computational procedures for achieving the input-output relationship. An algorithm must have the following properties: Correctness: It should produce the output according to the requirement of the algorithm. Finiteness: Algorithm must complete after a finite number of instructions have been executed. An Absence of Ambiguity: Each step must be defined having only one interpretation. Definition of Sequence: Each step must have a unique defined preceding and succeeding step. The first step and the la...

Python Vs Other Programming Language

  Python is a language of programming that is interpreted in general, dynamic, object-oriented, and high-level terminology. Python is designed to be highly readable. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages. Python ranked number one of the best programming languages of 20 according to the new report.Python is widely used by a lot of startups for building web applications using Django and it is also popular among data scientists. Characteristics  It includes both functional and formal programming approaches, and OOP. It can be used as a scripting language, or for large software creation it can be compiled to byte-code. It provides very high level structured data forms and facilitates the...

Graph coloring

  Graph Coloring A graph G(V, E) is given and some colors are given We have to color the vertices such that no two neighbours/adjacent vertices have the same color. This can be solved using Backtracking. There are two types of problem 1.  m-colorability decision problem If a graph G(V, E) is given and some colors are also given and just we want to know whether a graph can coloured using those colors or not. This is known as the m-coloring decision problem. 2.  m-colorability optimization problem If a graph G(V, E) is given and we want to know minimum how many colors required for coloring the graph. This problem is called the m-coloring optimization problem. Chromatic Number: The smallest number of colors needed to color a graph G is called its chromatic number.