Tag Archives: Algorithm

Programming Retrospection (Aug 4)

1. If the problem requirement is very complex, try to convert to simpler one. (In industry, you always get business requirement which is not efficient in technology, you should convert to a tech efficient algorithm/requirement) 标准复杂,就转换标准(蓄水池问题) 在工业界拿到的商业需求可能不是技术上的最优解,这种情况下就要优化需求(把商业需求转换成技术需求)。 2. Tow pointers … Continue reading

Posted in CS Research&Application, Uncategorized | Tagged , , | Leave a comment

Java Basics (Sorting, Classes)

Sorting if same time complexity, check # of swaps # of comparisons o(n^2) Insertion sort > Bubble sort > Selection sort in place (maybe only o(1) space) stable (same numbers’ relative position are same, 2,3,4,5(1),5(2)) o(nlogn) Quick sort o(1) extra … Continue reading

Posted in CS Research&Application, Uncategorized | Tagged , | Leave a comment

Programming Reflection (Jun 8, 2017)

1.  BITT Principle Brute Force (暴力解法,低效/费空间) Improvement (优化解法,高效/省空间) Time and space complexity (时间/空间复杂度) Test (测试) 2. Array is sorted and may have better performance (3Sum o(n^2) solution) 数组排序过后可能有奇效 3. Test cases are designed on purpose to test the functionality, not … Continue reading

Posted in CS Research&Application, Intern&Job, Uncategorized | Tagged , | Leave a comment

Programming Reflection (Jun 1, 2017)

1. Programming, programming, programming Keep brushing up algorithm and data structure problems Summarize the approach and the process to figure out solution 多刷题 多总结(回顾解题思路) 2. Technical Knowledge: Breadth vs Depth Concentrate on one in early stage, then learn about more 职业早期专精一门,之后拓展广度 … Continue reading

Posted in CS Research&Application, Intern&Job, Uncategorized | Tagged , | Leave a comment

Programming Reflection May 17

1. Array is easy to index specific element with index, it’s easier to calculate the difference between different elements than linked list. 2. LeetCode Trap Rain Water problem: iterate left and right elements for each element in the input array, … Continue reading

Posted in CS Research&Application, Intern&Job, IT, Uncategorized | Tagged , , , | Leave a comment

Leet Code Summary and Reflection

  Array Tips: keep two points and shrink from left and right to center, check to meet certain requirement (sum equals a target number) until left index is over right one. Problems: Two Sum, 3Sum, 3Sum Closest, 4Sum, etc.   … Continue reading

Posted in CS Research&Application, Intern&Job, IT, Uncategorized | Tagged , , | Leave a comment

Programming Reflections Mar 9

1. Create binary search tree from sorted array or linked list: It cannot access element via index in linked list as array, it uses direction to next node. Array creates root by middle term first, but linked list creates left … Continue reading

Posted in CS Research&Application | Tagged , , , , , | Leave a comment