摘要:
The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. Given any two nodes in a bin 阅读全文
摘要:
The "travelling salesman problem" asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shor 阅读全文
摘要:
When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in s 阅读全文
摘要:
Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game, player #1 阅读全文
摘要:
Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that 阅读全文
摘要:
The "eight queens puzzle" is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other. Thus, a solutio 阅读全文
摘要:
Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list. Input Specification: Each input file contains 阅读全文
摘要:
The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of inte 阅读全文
摘要:
This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed grap 阅读全文
摘要:
In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the 阅读全文