今天这道题还是比较简单的,但是我自己在纸上写的代码还是没有能够一次性通过,对递归的使用还是不够熟练。
题目
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
the way to root.
今天这道题还是比较简单的,但是我自己在纸上写的代码还是没有能够一次性通过,对递归的使用还是不够熟练。
题目
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
今天这道题比较简单,就不罗说了,是一个二叉树深度的判断,直接放代码记录一下,这里用了递归,应该还有更好的方法,有空了再想一想。
题目
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
最近用了很多翻墙的pac文件,从最开始的gfwlist到Floar_pac,再到用了一段时间的被clowwindy优化过时间复杂度为o(1)的gfwlist2pac。
这些pac文件里面效率最高,Performance最好的当属gfwlist2pac了,但是也有问题就是黑名单更新不够及时,有些国外网站走代理可能会更快些,这时候我就需要手动去修改这个pac文件里面的list来达到我的目的。
今天研究第一个LeetCode问题,按照计划AC Rate排序,通过率最高的就属这个了,那么就拿他当做入门第一课吧。
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. Could you implement it without using extra memory?
和写博客一样,计划了很久要把学过的算法重新捡起来,结果每次都是半途而废,无法多坚持几天。桌子上有关算法的书摆了一大堆,但是都没有看完过,除了上学时学的《算法导论》之外,基本都处于全新状态,实在是都有点不好意思把这些书放在这里了,我有一颗学好算法的心,但总是力不足,无法坚持,只能YY。
最近借着新博客安家的东风,希望有时间能继续完成我未完待续的“事业”,那就是不要在面试的时候害怕算法设计题,工作中的算法其实还好,大家讨论讨论,Google一下总能有思路,可是要是真面试的时候就有压力了,做不出来总觉得很丢人,计算机科学可不就是算法+数据结构么,这都不会还扯啥蛋呢。
一直有想找个地方写点东西,能让自己看看记录一下的想法,但总是找不到合适的地点和工具,Github试用了一段时间,总觉得太Geek不适合,每次写文章还要git push,还待自己找带预览的Markdown工具,而且有时候你本地预览的效果和放在网上效果不一样的时候又待改半天,这让我燃起的兴趣少了大半分,渐渐的也就懒得玩了。
You’re live! Nice. We’ve put together a little post to introduce you to the Ghost editor and get you started. You can manage your content by signing in to the admin area at <your blog URL>/ghost/. When you arrive, you can select this post from a list on the left and see a preview of it on the right. Click the little pencil icon at the top of the preview to edit this post and read the next section!