摘要:
8/11/2018 had a TOEFL test without preparation. Reading (worry about too much, not familiar with the topic, especially Science, time is tight) Geology 阅读全文
摘要:
Solution: O(n) , space: 栈空间O(logn)(from recusrsive expression)加上结果的空间O(n) : O(n) (good reference: https://blog.csdn.net/linhuanmars/article/details/23 阅读全文
摘要:
There are three problems in hackrank. two sum http request to get title binary search (find first large/small element)(网上没有一个现成运行的代码) 都是些不是很难的题, 但是因为是 阅读全文
摘要:
1. Solution: add popmax this func, you can pop out max at any time , so max stack to track the max elements does not work as minstack(leetcode 155) di 阅读全文
摘要:
Solution 1: use an arrayList to implement the min stack, here comes problem: how toget min element, use global min to tag minimal element and then sca 阅读全文
摘要:
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
摘要:
Reverse a linked list from position m to n. Do it in one-pass and in-place Note: 1 ≤ m ≤ n ≤ length of list. Example: FIrstly, I wanna use stack but n 阅读全文
摘要:
Given a singly linked list, determine if it is a palindrome. Example 1: Example 2: Follow up:Could you do it in O(n) time and O(1) space? Sloving with 阅读全文
摘要:
You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Note: You have to rotate the image in-place, which 阅读全文
摘要:
There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every 阅读全文