Fork me on GitHub
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 37 下一页
摘要: 1. 猎人把一对兔子婴儿(一公一母称为一对)放到一个荒岛上,两年之后,它们生下一对小兔,之后开始每年都会生下一对小兔。生下的小兔又会以同样的方式继续繁殖。 2. 兔子的寿命都是x(x>=3)年,并且生命的最后一年不繁殖。 3. 如果岛上的兔子多于10对,那么猎人会每年在兔子们完成繁殖或者仙逝之后,从 阅读全文
posted @ 2017-08-21 21:35 hellowOOOrld 阅读(1125) 评论(0) 推荐(0)
摘要: 题目: 给定一个包含1-n的数列,我们通过交换任意两个元素给数列重新排序。 求最少需要多少次交换,能把数组排成按1-n递增的顺序,(数组中的元素互不重复)。 比如 初始状态 5 4 3 2 1 。交换5和1的位置 得到 1 4 3 2 5,再交换4 2的位置得到 1 2 3 4 5.只需要两次即可。 阅读全文
posted @ 2017-08-20 22:06 hellowOOOrld 阅读(17840) 评论(7) 推荐(2)
摘要: Given a 2D integer matrix M representing the gray scale of an image, you need to design a smoother to make the gray scale of each cell becomes the ave 阅读全文
posted @ 2017-08-20 11:29 hellowOOOrld 阅读(379) 评论(0) 推荐(0)
摘要: Given a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maximum width among all levels. The binar 阅读全文
posted @ 2017-08-20 11:23 hellowOOOrld 阅读(248) 评论(0) 推荐(0)
摘要: Given a binary tree with n nodes, your task is to check if it's possible to partition the tree to two trees which have the equal sum of values after r 阅读全文
posted @ 2017-08-20 11:12 hellowOOOrld 阅读(620) 评论(0) 推荐(0)
摘要: 转载自:http://blog.csdn.net/qq_14935437/article/details/71081546 OSI模型,即开放式通信系统互联参考模型(Open System Interconnection,OSI/RM,Open Systems InterconnectionRefe 阅读全文
posted @ 2017-08-19 19:28 hellowOOOrld 阅读(1606) 评论(0) 推荐(0)
摘要: 一些容易记混的c++相关知识。 截图自:《王道程序员面试宝典》 阅读全文
posted @ 2017-08-16 21:29 hellowOOOrld 阅读(177) 评论(0) 推荐(0)
摘要: Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If the 阅读全文
posted @ 2017-08-13 11:12 hellowOOOrld 阅读(414) 评论(0) 推荐(0)
摘要: Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the or 阅读全文
posted @ 2017-08-13 11:01 hellowOOOrld 阅读(935) 评论(0) 推荐(0)
摘要: B树 即二叉搜索树: 1.所有非叶子结点至多拥有两个儿子(Left和Right); 2.所有结点存储一个关键字; 3.非叶子结点的左指针指向小于其关键字的子树,右指针指向大于其关键字的子树; 如: B树的搜索,从根结点开始,如果查询的关键字与结点的关键字相等,那么就命中; 否则,如果查询关键字比结点 阅读全文
posted @ 2017-08-11 11:08 hellowOOOrld 阅读(2363) 评论(1) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 37 下一页