Algorithm design and analysis related to the subject of the classic title effect

Divide and Conquer:

  1. Solving chessboard coverage problem: Given a 2 ^ k * 2 ^ k of the chessboard, in which happens to have a checkerboard squares with other squares are not the same. Conventional L-shaped free to rotate domino, seeking a non-duplicate coverage, and in addition special side cover covering the entire extra grid
  2. Date cyclic arrangements: n = 2 ^ k There are two players to the game, the game schedule arrangement meets the following requirements
    1. Each player needs time with other players of n-1 game
    2. Each player game once a day only
    3. In the end of the game n-1 days

Backtracking:

  1. Solving N queens problem: given a size of N * N chessboard, placing N queens in the board, and such that the horizontal line between the respective Queen, vertical lines, oblique lines under
  2. m coloring problem: Given an undirected graph and m colors, these colors with each vertex shader for the graph, all adjacent vertices are calculated as the number of different colors of colored solutions 

Greedy method:

  1. The maximum number of events given by the n activities start and end times, each time point by resource constraints, can only carry out an activity, find the n activities that can be performed: activities arrangements
  2. The number of containers loaded the n given container weight, and the load weight W wi ships, most seeking: optimal loading problem
  3. Flow-shop scheduling problem, batch job question: have two working machines, A can perform work, and the work B, the conventional n tasks, each task required to complete the work A, B after the completion of work, given each the time required to complete its task a work ai, and the time required to complete the work B bi, minimum time required to complete all tasks

 Dynamic Programming:

  1. And maximum continuous sequence: the sequence given n digits, a contiguous sequence of numbers and called this sequence and the sequence was determined sequence of all sequences and this maximum subsequence sequence
  2. Edit distance problem: Given two strings, the minimum number of characters required operations, such that two strings are the same. Three existing character operation method,
    1. To delete a character
    2. Insert a character
    3. Alternatively a character to another character

 

Published 42 original articles · won praise 16 · views 3396

Guess you like

Origin blog.csdn.net/qq_41542638/article/details/103665101