Want to see more problem-solving reports:Http://blog.csdn.net/wangjian8006/article/details/7870410Reprinted please indicate the source:Http://blog.csdn.net/wangjian8006
Question:
Input two numbers N, K two numbers, ask how many steps from N
Rescue (rescue)
Zoj monthly, October 2003, zoj1649
Description:
Angel was caught by moligpy and she was locked in jail. The prison can be described using a matrix of n × m, 1
≤ 200. The prison consists of n × m squares, each of which can be
// Strongly connected component // question: Start from u to V, and start from V to the points of U and output them; // obtain several strongly connected components of a graph. If the shrinkage degree in the strongly connected component is 0, all
Want to see more problem-solving reports: http://blog.csdn.net/wangjian8006/article/details/7870410Reprinted please indicate the source: http://blog.csdn.net/wangjian8006
Question:
There are two stacks of cards, S1 and S2. Now the C card is S2,
Want to see more problem-solving reports: http://blog.csdn.net/wangjian8006/article/details/7870410Reprinted please indicate the source: http://blog.csdn.net/wangjian8006
Question:
The company wants to invent a new shredder that requires the new
Tarjan Algorithm for Directed Graph strongly connected components
From: http://www.byvoid.com/blog/tag/%E5%9C%96%E8% AB %96
[Digraph strongly connected component]
In directed graph G, if at least one path exists between two vertices, the two
2-3-1:
2-3-2:
MERGE2(A,p,q,r) n1=q-p+1 n2=r-q let L[1..n1]and R[1...n2] be new arrays for i=1 to n1 L[i]=A[p+i-1] for j=1 to n2 R[j]=A[q+j] i=1 j=1 k=1 while in1 and jn2 A[k]=L[i]k=k+1i=i+1
2-3-4:
// Enter a [1..
Want to see more problem-solving reports: http://blog.csdn.net/wangjian8006/article/details/7870410Reprinted please indicate the source: http://blog.csdn.net/wangjian8006
Solution: similar to the eight queens problem, DFS brute force Solution
Code:
Want to see more problem-solving reports:Http://blog.csdn.net/wangjian8006/article/details/7870410Reprinted please indicate the source: http://blog.csdn.net/wangjian8006
Give a 4x4 period disk. B Indicates white, W indicates black. When a piece is
What is comparative sorting.
In the final result of sorting, the order of elements depends on the comparison between them. Insert sorting, Merge Sorting, heap sorting, and quick sorting are all relatively sorted.
The performance of comparative
Allocate manages memory allocation.
Here, we mainly consider memory management for small blocks. If the small block is directly allocated using the new operator, memory fragmentation will occur first, and additional load will be incurred during the
// Myiterator # ifndef _ myiterator # DEFINE _ myiterator // The iterator is a smart pointer // define the five types of iterators using the inheritance relation struct input_iterator_tag {}; struct out_put_tag {}; struct forward_iterator_tag:
// Myconstruct. h # ifndef _ myconstruct # DEFINE _ myconstruct # include "myiterator. H "# include Using STD: copy; Using STD: fill_n; Using STD: Fill; **********************/// five global functions, apply to uninitialized space // set the
Stacks and queues are widely used. Their ideas are consistent with those in graph theory for deep and breadth-first searches.
To put it simply, the stack and the queue are both containers, and the stack is FIFO and the queue is FIFO;
I. stack
I-th sequence statistic: Elements smaller than I;
For an array of n elements, when n is an odd number, the median is the I = (n + 1)/Two sequence statistics. When n is an even number, the median is the sequence statistic I = n/2 and I = n/2 + 1.
/* The Binary Search Tree is a binary tree. It becomes a search tree because it is applicable to most search-related algorithms. * Most of them adopt this strategy, including tree B, it can also be seen as an extension of the binary search tree *
This code is written to you, so there is no comment. You can go to Mr Hou Jie's STL source code analysis.
// Mydeque. h # include "myconstruct. H "# include" mymemory. H "Using STD: Max; Using STD: copy_backward;/* deque is a continuous linear
First, I wrote a simple single-chain table with poor code writing:
# Include "mymemory. H "# include" myconstruct. H "# include // simple single-chain table template struct _ slist_node {t data; _ slist_node * Next ;}; // since it is a simple
# Include // STL dual-chain table, which works with the iterator # include "mymemory. H "# include" myconstruct. H "template struct _ list_node {typedef void * void_pointer; void_pointer Prev; // it can be set to _ list_node * void_pointer next;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service