top of page

/////////////////////////////////////////////////////////////////////////////////////////////////////////

Decrease and Conquer 

Reduce the problem in smaller units of the same problem.

And solve a smaller problem.

Find the original solution extending solution of smaller problem.

Example 

{ 1 }

DFS (Depth - First - Search)

Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. 

 

  1. Usually start at A

  2. In alphabetical order, choose next node.​

  3. Down until there is no more choice below.

  4. If there is not node, back to another cross.

BFS (Breadth - First - Search)

{ 2 }

Breadth-first search (BFS) is an algorithm for searching tree or graph like DFS.

 

  1. Usually start A.

  2. In alphabetical order, choose next node

  3. Unlike DFS, BFS visit same line node first.

  4. If there is not node on same line, down to child node

GROUP PROJECT

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Numbers Game

This program is Numbers Game.

It is win when User find the answer which computer think.

 

  1. Input the number.

  2. If the answer is multiple of input,
    the multiples do not erase.
    Else, multiples erase.

  3. Repeat step2, then user think what is answer.

  1. Decrease by one : reduce problem into one.

    - Depth-first-search
    - Breadth-first-search

  2. Decrease by a constant factor : reduce problem into constant unit.
    Fake Coin Puzzle
    Russian peasant
    Josephus problem

  3. Variable-size decrease. : reduce problem in variable-size unit

    - Euclid's algorithm for greatest common divisor

    - Selection problem

    - Binary search Tree

What kind of decrease and conquer algorithm?

What is the difference?

Decrease and Conquer

After dividing the problem into smaller units, part which seems to be not answer has not been confirmed

Divide and Conquer

Solve each problem after the original problem is divided in two units

Brute Force

Check all of the case about problem

Binary Search Tree

{ 3 }

Key  Point

 

  • The parent node is larger than left-child node.

  • The parent node is smaller than right-child.

  1. Start at the highest node.

  2. If element smaller than node, down to left.
    Else, down to right.

  3. Repeat this step2 until finding the element.

SOLUTION

bottom of page