摘要:
理解 我们可以把N个数两两建立无向边(即任意两个结点之间都有边,也就是一个N个结点的完全图),然后对每个点作为起点,分别做一次深度优先遍历,当所有点都已经标记时输出当前的遍历路径,就是其中一个排列,这里需要注意,回溯的时候需要将原先标记的点的标记取消,否则只能输出一个排列。如果要按照字典序,则需要在 阅读全文
摘要:
1.题目A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belon... 阅读全文
摘要:
1.题目The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and t... 阅读全文
摘要:
1.题目Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy s... 阅读全文
摘要:
1.题目A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:... 阅读全文
摘要:
1.题目According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growi... 阅读全文