原创 CC150 chapter 8 OOD

Object-oriented design is a very good situation for interviewers to test whether or not the candidates know about codin

原创 Leetcode tree的碎碎念

關於Leetcode 中的Tree應該是最簡單的一類題。 絕大部分題考察隊樹的遍歷,前序,中序,後序對樹的遍歷。 然後還有各種變形體考對樹的遍歷, 還有其他題型考對樹的前序遍歷 path sum, the maximum depth

原创 Leetcode 286. Walls and Gates

You are given a m x n 2D grid initialized with these three possible values. -1 - A wall or an obstacle.0 - A gate.INF 

原创 Leetcode 314 Binary Tree Vertical Order Traversa

This question is nothing fancy, just need to get the position that the root should be. and the length for the whole arr

原创 Leetcode 274. H-Index

轉自 http://www.cnblogs.com/yrbbest/p/5031910.html 這道題我們沒有必要完全排序。這樣就多餘了。 第二種Time complexity is O(n) 的方法比較好,這樣我們可以利用Array

原创 Leetcode 48. Rotate Image

You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up:

原创 CC150 16 chapter operating system

There are more fundamental problems in CC150, so it would be good if I can go through the problems in CC150 and go over

原创 Leetcode 249 Group Shifted Strings

The idea is from this post https://hzhou.me/LeetCode/LeetCode-Group-Shifted-Strings.html LeetCode: Group Shifted St

原创 Leetcode 296 Best Meeting Point

Best Meeting Point Total Accepted: 701 Total Submissions: 1714 Difficulty: Medium A group of two or more peopl

原创 Leetcode 159 Longest Substring with At Most Two Distinct Characters

This question is quite simple. we do not even use the hash table, cause there just would be two distinct characters in

原创 Leetcode 252 Meeting Rooms

Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine

原创 CC150 Bit manipulation

The big manipulation problem on CC150 is quite tricky/ there are basically fundamental operation like and or and xor. 

原创 CC150 chapter 1 Arrays and strings.

CC150 chapter 1 總結 1 HashTable:  實質是Array. 如何實現HashTable 在Java中 Here is the way that implments the hash table. A hashta

原创 CS 4820 second lecture

stable matching algorithem https://en.wikipedia.org/wiki/Stable_marriage_problem 點贊 收藏 分享 文章舉報

原创 Leetcode 90. Subsets II

iven a collection of integers that might contain duplicates, nums, return all possible subsets. Note: Elements in a s