算法
raynforu
a simple hello-worlder
展开
-
leetcode oj 1
Merge Sorted Array 引用块内 这是leetcode 一道简单的OJ题,主要就是理解二分查找,这一题看起来很简单,但是不理解二分查找的话,做起来会有大大小小不少问题, 下面给出解析和答案其实主要就是二分查找算法稍微变形一下,二分查找的过程是将有序数组一分为2,不停的循环,最终查找到目标所在的位置,如果目标不在数组当中,返回-1。本题则是如果数组中不存在该目标值,则返回该目标原创 2015-07-27 18:38:48 · 394 阅读 · 0 评论 -
leetcode oj 2
Merge Sorted Array Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note: You may assume that nums1 has enough space (size that is greater or equal to m +原创 2015-07-27 18:43:48 · 230 阅读 · 0 评论 -
leetcode oj3
Department Highest SalaryThe Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id.+—-+——-+——–+————–+ | Id | Name | Salary | Departm原创 2015-07-29 11:41:07 · 240 阅读 · 0 评论