• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅

随笔分类 -  Summary

1 2 3 下一页
Leetcode: Design HashMap && Summary: HashMap

只有注册用户登录后才能阅读该文。
posted @ 2019-11-14 15:45 neverlandly 阅读(6) 评论(0) 推荐(0)
Leetcode: Design Bounded Blocking Queue && Summary of Reentrant Lock

只有注册用户登录后才能阅读该文。
posted @ 2019-10-30 14:24 neverlandly 阅读(8) 评论(0) 推荐(0)
Leetcode: Optimize Water Distribution in a Village && Summary: Union Find and Minimum Spanning Tree

只有注册用户登录后才能阅读该文。
posted @ 2019-10-17 14:24 neverlandly 阅读(5) 评论(0) 推荐(0)
Summary: curated List of Top 75 LeetCode Questions to Save Your Time

摘要:Facebook / Eng tech lead Dec 30, 2018 68 Comments Facebook / Eng tech lead Facebook / Eng tech lead Dec 30, 2018 68 Comments New Year Gift to every fe 阅读全文
posted @ 2019-09-22 07:50 neverlandly 阅读(462) 评论(0) 推荐(0)
Summary: Calculate average where sum exceed double limits

摘要:According to the highest vote in: http://stackoverflow.com/questions/1930454/what-is-a-good-solution-for-calculating-an-average-where-the-sum-of-all-v 阅读全文
posted @ 2017-01-31 01:38 neverlandly 阅读(281) 评论(0) 推荐(0)
Summary: How to calculate PI? Based on Monte Carlo method

摘要:refer to: http://www.stealthcopter.com/blog/2009/09/python-calculating-pi-using-random-numbers/ During my undergraduate degree I wrote a program in fo 阅读全文
posted @ 2017-01-09 13:34 neverlandly 阅读(676) 评论(0) 推荐(0)
Leetcode: LFU Cache && Summary of various Sets: HashSet, TreeSet, LinkedHashSet

摘要:referred to: https://discuss.leetcode.com/topic/69137/java-o-1-accept-solution-using-hashmap-doublelinkedlist-and-linkedhashset Two HashMaps are used, 阅读全文
posted @ 2016-12-24 03:43 neverlandly 阅读(575) 评论(0) 推荐(0)
Leetcode: Word Squares && Summary: Another Important Implementation of Trie(Retrieve all the words with a given Prefix)

摘要:Backtracking + Trie: referred to https://discuss.leetcode.com/topic/63516/explained-my-java-solution-using-trie-126ms-16-16 A better approach is to ch 阅读全文
posted @ 2016-12-20 01:38 neverlandly 阅读(678) 评论(0) 推荐(0)
Leetcode: Longest Substring with At Most K Distinct Characters && Summary: Window做法两种思路总结

摘要:我的做法:维护一个window,r移动到超出k distinct character限制是更新max,然后移动l使distinct character <=k; 这种做法更新max只发生在超出限制的时候,有可能永远都没有超出限制,所以while loop完了之后要补上一个max的更新 别人非常棒的做 阅读全文
posted @ 2016-12-15 11:41 neverlandly 阅读(205) 评论(0) 推荐(0)
Leetcode: Combination Sum IV && Summary: The Key to Solve DP

摘要:DP 解法: the key to solve DP problem is to think about how to create overlap, how to re-solve subproblems(怎么制造复用) Bottom up dp: Better Solution(Bottom-u 阅读全文
posted @ 2016-11-28 11:40 neverlandly 阅读(328) 评论(0) 推荐(0)
Leetcode: Sum of Two Integers && Summary: Bit Manipulation

摘要:转自https://discuss.leetcode.com/topic/49771/java-simple-easy-understand-solution-with-explanation/2,注意里面对于减法的讲解 have been confused about bit manipulati 阅读全文
posted @ 2016-11-26 11:53 neverlandly 阅读(349) 评论(0) 推荐(0)
Groupon面经Prepare: Sort given a range && Summary: Bucket Sort

摘要:首先是如何sort一个只有0和1的数组,要求inplace. follow up是告诉一个range,如何在O(N)时间内sort好 两个pointer可解 1 package Sorting; 2 import java.util.*; 3 4 public class InplaceSortin 阅读全文
posted @ 2016-02-04 01:27 neverlandly 阅读(370) 评论(0) 推荐(0)
Summary: Final Keyword

摘要:In this tutorial we will learn the usage of final keyword. final keyword can be used along with variables, methods and classes. We will cover followin... 阅读全文
posted @ 2016-01-19 13:01 neverlandly 阅读(240) 评论(0) 推荐(0)
Leetcode: Range Sum Query 2D - Mutable && Summary: Binary Indexed Tree

摘要:参考:https://leetcode.com/discuss/72685/share-my-java-2-d-binary-indexed-tree-solution Build binary indexed tree takes : O(mn*logm*logn) time, both upda 阅读全文
posted @ 2016-01-18 05:44 neverlandly 阅读(1502) 评论(0) 推荐(0)
Summary: Merge Sort of Array && 求逆序对

摘要:常用算法(后面有inplace版本): 1 package ArrayMergeSort; 2 3 import java.util.Arrays; 4 5 public class Solution { 6 public int[] mergeSort(int[] arr) { 7 if (arr 阅读全文
posted @ 2016-01-14 12:34 neverlandly 阅读(374) 评论(0) 推荐(0)
Summary: Process & Tread

摘要:refer tohttp://www.programmerinterview.com/index.php/operating-systems/thread-vs-process/A process is an executing instance of an application. What do... 阅读全文
posted @ 2016-01-14 02:51 neverlandly 阅读(252) 评论(0) 推荐(0)
Leetcode: Range Sum Query - Mutable && Summary: Segment Tree

摘要:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.The update(i, val) function modifies nums by upda... 阅读全文
posted @ 2016-01-02 13:48 neverlandly 阅读(492) 评论(0) 推荐(0)
Leetcode: Number of Islands II && Summary of Union Find

摘要:Union Find Princeton's lecture note on Union Find in Algorithms and Data Structures It is a well organized note with clear illustration describing fro 阅读全文
posted @ 2015-12-30 08:09 neverlandly 阅读(3757) 评论(0) 推荐(0)
Leetcode: Alien Dictionary && Summary: Topological Sort

摘要:There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of words from the... 阅读全文
posted @ 2015-12-27 12:05 neverlandly 阅读(575) 评论(0) 推荐(0)
Leetcode: Graph Valid Tree && Summary: Detect cycle in undirected graph

摘要:This problem can be solved by using union find, reference this blog:https://segmentfault.com/a/1190000003791051 复杂度 时间 O(N^M) 空间 O(N) 思路 判断输入的边是否能构成一个 阅读全文
posted @ 2015-12-24 02:58 neverlandly 阅读(1012) 评论(0) 推荐(0)

1 2 3 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3