原创 Leetcode 173. Binary Search Tree Iterator

Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.

原创 Leetcode 253 Meeting Rooms II

This is the link to this problem http://leetcode0.blogspot.com/2015/12/253-meeting-rooms-ii.html The idea is to for e

原创 Amazon on compus 面經

coding題 circular sorted linked list的插入,backtracking走迷宮,還有內存管理的LUR算法~ 這三種題型。 編程題用C++的話,不支持自己寫子函數。遞歸只能自己寫Stack. 這裏有面

原创 Leetcode 146. LRU Cache

Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations

原创 DFS + BackTracking

這是Leetcode經典系列題,就是考對於DFS的理解,確實有技術含量 想上來Combination上來熱一下身,如何回溯。就是加1,減1 然後是Combination sum1 combination sum2  combinat

原创 Google 面試題 phone interview

摘自一畝三分地 http://www.1point3acres.com/bbs/forum.php?mod=viewthread&tid=200350&extra=page%3D1%26filter%3Dsortid%26sortid%

原创 GeeksforGeeks 上關於時間空間複雜度的大O和大zeta分析

傳送門: http://www.geeksforgeeks.org/analysis-of-algorithms-set-3asymptotic-notations/ 我覺得大zita是下界 大O是上界

原创 GeeksforGeeks 統計一個數組中的相反的數的對數

原帖在這裏使用merge sort的方法 naive 的方法是O(n2) 可以利用merge sort提升到O(nlogn) http://www.geeksforgeeks.org/counting-inversions/ This

原创 geeksforgeeks

這個是對space complexity 的解釋 http://www.geeksforgeeks.org/g-fact-86/ 我在面試的時候得問清楚這個time complexity算不算input的size 如果算是怎麼做,如果不算

原创 Geeksforgeeks time complexity

一個time complexity 的問題 http://www.geeksforgeeks.org/a-time-complexity-question/

原创 GeeksForGeeks Power(x,n)

This is a example to use the divide and conquer Write a program to calculate pow(x,n) Power(x,n)這裏用一個int tem 記錄Power

原创 Leetcode 322. Coin Change

You are given coins of different denominations and a total amount of money amount. Write a function to compute the fe

原创 KMP 算法

This is a String matching algorithm, to match the target string to a txt string This is wikipedia https://en.wikipedia

原创 Amazon coding 題解答

沒有過了test,之後回來跟新 1 LRU /** Design and implement a data structure for Least Recently Used (LRU) cache. It should support

原创 Amazon面經2016/2

樓主拖到了二月份纔開始完全的熱好身準備找實習是在是略SB,要是早點現在估計Offer 都有了吧 Amazon 面經 有人說大概10天左右從內推進入Phone interview. 我了個擦,我應該在學期之中找的,還是消息不夠靈通啊,