マツシタのお勉強

2017-01-06から1日間の記事一覧

Range Sum Query 2D - Mutable : Past Google Coding Interview

Problem https://leetcode.com/problems/range-sum-query-2d-mutable/ How to Solve This problem can be solved by using Binary Indexed Tree. Please check below article if you want to know the details of Binary Indexed Tree. keita-matsushita.hat…

Binary Indexed Tree Implementation : Java

Binary Indexed Tree (BIT) Binary Indexed Tree makes it possible to implement the following queries with O(log N). To calculate sum of values in range To update the value of index Basic idea This structure is Binary Tree like Segment Tree. …

316. Remove Duplicate Letters : Past Google Coding Interview

Problem leetcode.com How to Solve This problem is solved by the following steps. find out index that each letter appears int the last position have the indexes calculating at step 1 in a array sort the arrays created at step2 4 check the s…