Tony's Log

Algorithms, Distributed System, Machine Learning

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

05 2016 档案

摘要:Problem Reason Reference Moving ZeroesSort Colors Corner cases Shortest Word Distance Thought: 2 ptr chasing Merge 2 sorted ListsRemove Linked List El 阅读全文
posted @ 2016-05-18 09:34 Tonix 阅读(129) 评论(0) 推荐(0)

摘要:Kruskal Algorithm is based on Union-Find - quite intuitive. 阅读全文
posted @ 2016-05-11 13:52 Tonix 阅读(332) 评论(0) 推荐(0)

摘要:An intuitive Prim algorithm impl. 阅读全文
posted @ 2016-05-11 07:14 Tonix 阅读(280) 评论(0) 推荐(0)

摘要:We don't have to keep a complete chess board.. just counters! 阅读全文
posted @ 2016-05-07 14:05 Tonix 阅读(304) 评论(0) 推荐(0)

摘要:Two tricks here: 1. Counting no. of inversed pairs - using Merge Sort, nothing special 2. How to check 'chaotic'? We simply check if any number is ove 阅读全文
posted @ 2016-05-07 13:30 Tonix 阅读(604) 评论(0) 推荐(0)

摘要:A typical solution is heap based - "top K". Complexity is O(nlgk). There is a O(n) one indeed - bucketing the frequencies.https://leetcode.com/discuss 阅读全文
posted @ 2016-05-03 09:19 Tonix 阅读(189) 评论(0) 推荐(0)