![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
春田花花幼儿园编程班
lqy0927
能把功能实现了再说=0=
展开
-
【Calendar Function】计算日期差
问题:求解year1-month1-day1 和 year2-month2-day2的日期差 思路:将两个date间的间隔天数计算转换为计算两个日期到同一基准日期的天数差 说明(如图所示): 求解dist1, _dist2(year-month-day是year那一年的第多少天) 求解sum(year1一整年的天数 + 中间所有年的天数(365or366)...原创 2018-08-06 19:46:59 · 1127 阅读 · 0 评论 -
【Binary Search】二分查找(普通二分查找;重复元素返回第一个索引的二分查找;查找范围为2次幂的二分查找)
/* common binarySearch */int commonbinarySearch(int arr[], int len, int key){ int index = -1; int low=0, high=len-1, mid; while(low <= high){ mid = (low + high) / 2; i...原创 2018-08-07 00:40:11 · 915 阅读 · 0 评论 -
【LeetCode 665 Non-decreasing Array】
Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element.We define an array is non-decreasing if array[i] <= array[i + 1] holds for e...原创 2018-08-22 11:03:46 · 109 阅读 · 0 评论