摘要: 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 阅读全文
posted @ 2018-08-12 10:00 wz30 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Solution: O(n) , space: 栈空间O(logn)(from recusrsive expression)加上结果的空间O(n) : O(n) (good reference: https://blog.csdn.net/linhuanmars/article/details/23 阅读全文
posted @ 2018-08-10 15:11 wz30 阅读(171) 评论(0) 推荐(0) 编辑
摘要: There are three problems in hackrank. two sum http request to get title binary search (find first large/small element)(网上没有一个现成运行的代码) 都是些不是很难的题, 但是因为是 阅读全文
posted @ 2018-08-09 15:56 wz30 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-08-09 13:28 wz30 阅读(335) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-08-08 03:22 wz30 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-08-07 06:09 wz30 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-08-06 06:51 wz30 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-08-05 10:48 wz30 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-07-30 10:11 wz30 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-07-26 08:41 wz30 阅读(138) 评论(0) 推荐(0) 编辑