• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅
2015年4月2日
Lintcode: Search a 2D matrix II
摘要: Write an efficient algorithm that searches for a value in an m x n matrix, return the occurrence of it.This matrix has the following properties: * ... 阅读全文
posted @ 2015-04-02 12:26 neverlandly 阅读(2222) 评论(0) 推荐(0)
Lintcode: Rehashing
摘要: The size of the hash table is not determinate at the very beginning. If the total size of keys is too large (e.g. size >= capacity / 10), we should do... 阅读全文
posted @ 2015-04-02 11:13 neverlandly 阅读(850) 评论(0) 推荐(0)
Lintcode: Recover Rotated Sorted Array
摘要: Given a rotated sorted array, recover it to sorted array in-place.Example[4, 5, 1, 2, 3] -> [1, 2, 3, 4, 5]ChallengeIn-place, O(1) extra space and O(n... 阅读全文
posted @ 2015-04-02 10:33 neverlandly 阅读(1366) 评论(0) 推荐(0)
Lintcode: Product of Array Exclude Itself
摘要: Given an integers array A.Define B[i] = A[0] * ... * A[i-1] * A[i+1] * ... * A[n-1], calculate B without divide operation.ExampleFor A=[1, 2, 3], B is... 阅读全文
posted @ 2015-04-02 09:59 neverlandly 阅读(1932) 评论(0) 推荐(0)
Lintcode: Previous Permuation
摘要: Given a list of integers, which denote a permutation.Find the previous permutation in ascending order.NoteThe list may contains duplicate integers.Exa... 阅读全文
posted @ 2015-04-02 07:01 neverlandly 阅读(1212) 评论(0) 推荐(0)
Lintcode: Partition Array
摘要: Given an array "nums" of integers and an int "k", Partition the array (i.e move the elements in "nums") such that, * All elements = k are moved to ... 阅读全文
posted @ 2015-04-02 06:21 neverlandly 阅读(1702) 评论(0) 推荐(0)
Lintcode: O(1) Check Power of 2
摘要: Using O(1) time to check whether an integer n is a power of 2.ExampleFor n=4, return trueFor n=5, return falseChallengeO(1) timeTags Expand 这道题考察bit m... 阅读全文
posted @ 2015-04-02 05:24 neverlandly 阅读(575) 评论(0) 推荐(0)
Lintcode: Minimum Adjustment Cost
摘要: 1 Given an integer array, adjust each integers so that the difference of every adjcent integers are not greater than a given number target.2 3 If the ... 阅读全文
posted @ 2015-04-02 04:56 neverlandly 阅读(1961) 评论(0) 推荐(0)
Lintcode: Nth to Last Node in List
摘要: Find the nth to last element of a singly linked list. The minimum number of nodes in list is n.ExampleGiven a List 3->2->1->5->null and n = 2, return... 阅读全文
posted @ 2015-04-02 03:40 neverlandly 阅读(553) 评论(0) 推荐(1)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3