摘要:
题目: Description: Count the number of prime numbers less than a non-negative number, n. Credits:Special thanks to @mithmatt for adding this problem and 阅读全文
摘要:
题目: Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bottom left corner and top right corner 阅读全文
摘要:
题目: Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 阅读全文
摘要:
题目: Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For 阅读全文
摘要:
题目: 建立一颗二叉查找树,输出每个节点的数值以及该节点的左右子树的数值。 格式如下: 输入格式: 第一行输入一个正整数 N (1 <= N <= 1000),代表序列里元素个数。 第二行输入 N 个正整数,代表序列 a 的 N 个元素(0 <= ai <= 10000)。保证序列里的元素值互不相同 阅读全文
摘要:
1.树形结构广泛存在我们的现实生活里,如下两张图,第一张是 Linux 文件系统结构,第二张是美国福特汽车公司的汽车家谱图。类似的树形结构还有很多,他们都可以抽象成数据结构里的树。和自然界里的树有所类似又有所不同,他们都有且仅有一个树根,树上的元素都是从树根衍生出来的。不同的是自然界里的树,它的树根 阅读全文