几种遍历二叉树的方法

遍历二叉树是学习算法与数据结构必学的内容,在leetcode网站上有好几道相关的题,本文也是从那里引出的:

  1. Binary Tree Preorder Traversal

阅读全文

LeetCode --- Single Number 2

OJ地址

英文原题:

Given an array of integers, every element appears three times except for one. Find that single one.

阅读全文

2014展望

(梦想路飞)

送走了2013迎来2014,想了想,这一年要做的事真的挺多的,且大致说说,详细的计划就不说的,自己知道就行了。

###关于时间

时间这东西就像是一个只能取不能存的银行账户一样,只会越来越少。所以跟之前说的那样,实践时间统计法,不断完善,好好使用我自己的时间,提高效率,做好规划。不然,下面说的想做的事就免不了到处磕磕碰碰。所以一件贯穿始终的事:

阅读全文

我的2013

2013年,本科毕业,众同学工作的工作,留学的留学,剩下几个读研了。我也是那剩下的几个之一。

今天做个小小的年度总结,虽然还没到12月31号,但我总觉得我的2013年(学习、工作年度)早可以结束了,进入下一年度了。

###关于学业

首先,从学业开始。2013年是大四下学期,除了写了个毕业论文,没有什么和本科有关的学业了,毫无悬念的顺利毕业。接着就保研本院读研究生,到现在新年将近,本学期已经结束了算是2门课了,剩下两篇英语作文、一场机试、一场笔试和一篇小论文。

阅读全文

读《奇特的一生》

第一次看到柳比歇夫这个名字是在李笑来老师的《把时间当作朋友》一书中。当时从书中看到他,我有的只是对他对时间的精确的感知感到佩服与崇拜,并没有特别在意他的时间统计法。不过倒是将书中提到的文献性小说《奇特的一生》放入了读书列表中。最近终于拜读了这本《奇特的一生》,也领略了柳比歇夫的时间统计法。

阅读全文

The Road Less Travelled 摘录

Life if difficult.
This is a great truth, one of the greatest truths. It is a great truth because one we truly see this truth, we transcend it. Once we truly know that life is difficult — once we truly understand and accept it — then life is no longer difficult. Because once it is accepted, the fact that life is difficult no longer matters.

阅读全文

LeetCode --- Remove Element

原题:

Given an array and a value, remove all instances of that value in place and return the new length.

The order of elements can be changed. It doesn't matter what you leave beyond the new length.

阅读全文

LeetCode --- Remove Duplicates from Sorted Array

原题:

Given a sorted array, remove the duplicates in place such that each element appear 
only once and return the new length.

Do not allocate extra space for another array, you must do this in place with constant memory.

阅读全文

LeetCode --- Single Number

英文原题:

Given an array of integers, every element appears twice except for one. Find that single one.

Note:
Your algorithm should have a linear runtime complexity. 

阅读全文

LeetCode --- Reverse Integer

原题:

Reverse digits of an integer.

Example1: x = 123, return 321
Example2: x = -123, return -321

阅读全文