Thursday, May 25, 2017

Coding Interviews - Harry He

May 25, 2017

Introduction


It is such a great book and Julia read the book back in 2015. Now it is the time to review the book again.

Book reading 


Question 69: Median of a stream (Julia's ranking:  10 out of 10  May 31, 2017)

Leetcode 295. Find median from data stream - discussion panel is here.

C# solution using SortedSet. The C# code to study is here.

C# solution using MinHeap/ MaxHeap - self defined. The study code is here.

Read blog about the discussion again - link is here - the blog on ardendertat.com



Question 85: binary tree is balanced? (Julia's ranking:  8 out of 10  May 31, 2017)


Algorithm 90: Given an array, check whether it contains a subset of numbers whose sum equals to 0

A little confused about solution discussed in the book, look up Google and then find this blog on geeksforgeeks:
Dyanmic programming / Set 25 ( Subset Sum Problem), recursive and also dynamic programmng solution.

Study leetcode 416: partition equal subset sum. The problem link is here.

Amazonian - USC alumni - Xie Tao - Leetcode profile is here.

Study the solution:
Java dynamic programming solution is here.

Study Leetcode 39: Combination Sum,
Julia's C# practice is here.

Leetcode 40 Combination Sum II.

Julia's C# practice is here.


Algorithm 93: Maximum in Queue

Leetcode 239 Sliding window maximum

Algorithm 98: Most profit from stock
June 8, 2017
Leetcode 121
Julia's C# practice is here

Leetcode 122
Julia's C# practice is here




No comments:

Post a Comment