上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 27 下一页
摘要: You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places of nums2.Th... 阅读全文
posted @ 2017-02-09 22:58 xiejunzhao 阅读(157) 评论(0) 推荐(0)
摘要: Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one an... 阅读全文
posted @ 2017-02-07 22:55 xiejunzhao 阅读(237) 评论(0) 推荐(0)
摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.Here... 阅读全文
posted @ 2017-02-03 22:05 xiejunzhao 阅读(181) 评论(0) 推荐(0)
摘要: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return 2.给定一个包含从0, 1, 2, ..., n, 选出的n个不同数字的数组,从中... 阅读全文
posted @ 2017-02-03 21:31 xiejunzhao 阅读(184) 评论(0) 推荐(0)
摘要: Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same el... 阅读全文
posted @ 2017-02-01 22:58 xiejunzhao 阅读(166) 评论(0) 推荐(0)
摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers su... 阅读全文
posted @ 2017-02-01 19:55 xiejunzhao 阅读(140) 评论(0) 推荐(0)
摘要: For a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page, whose length L... 阅读全文
posted @ 2017-01-30 22:31 xiejunzhao 阅读(156) 评论(0) 推荐(0)
摘要: 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 + n) to hold additional ... 阅读全文
posted @ 2017-01-28 19:13 xiejunzhao 阅读(125) 评论(0) 推荐(0)
摘要: 函数指针重载:参数类型要匹配,指针类型必须精确匹配 使用decltype作用于某个函数时,要显示加上*以表示我们需要返回指针,而非函数本身 int func(int a, int b);using pFunc1 = decltype(func) *;typedef decltype(func) *pFunc2;using pFunc3 = int (*)(int a, int b);using ... 阅读全文
posted @ 2017-01-28 17:37 xiejunzhao 阅读(116) 评论(0) 推荐(0)
摘要: 顶层const:指针本身是常量,不能改变指针的指向底层const:指针指向一个常量,不能改变指向对象的值null 阅读全文
posted @ 2017-01-28 17:36 xiejunzhao 阅读(106) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 27 下一页