犒劳一下自己

​ 心情不好的时候,可能这时候真的已经很疲惫了。 ​ 不要继续沮丧让自己的心情更糟糕,或许这个时候应该犒劳一下自己,让自己的心情放松,晴朗起来或许一切看起来回事那么情切舒服!

Read More

HouseRobberIII

The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that “all houses in ...

Read More

Target Sum

You are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol. Find out how many ways to assign symbols to make sum of integer...

Read More

QueueReconstructionbyHeight

Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of this person who have a height greater than or equal...

Read More

烦躁

​ 下午两点过一点,从宿舍走出来,外面还是淅淅沥沥下着小雨。心里不是很舒服,一直不喜欢下雨,阴冷的天气,总是让人觉得不适,什么都不适合,不适合上课不适合看书,就想让人躺在床上。躺在床上就不经意间会回忆到以前,想到种种。 ​ 算了不管了,还是去实验室一个人清净一会,这里就我一个人。拉上窗帘根本看不到外面在下雨,就好像一个晴天的夜晚。 ​ 打开电脑准备看看 Coursera 上面的算法,可是静不下心来,真的静不下心来!我尽力让自己平静,关掉了窗口,算了!刷题吧,连续点开了三道...

Read More

烦躁

​ 下午两点过一点,从宿舍走出来,外面还是淅淅沥沥下着小雨。心里不是很舒服,一直不喜欢下雨,阴冷的天气,总是让人觉得不适,什么都不适合,不适合上课不适合看书,就想让人躺在床上。躺在床上就不经意间会回忆到以前,想到种种。 ​ 算了不管了,还是去实验室一个人清净一会,这里就我一个人。拉上窗帘根本看不到外面在下雨,就好像一个晴天的夜晚。 ​ 打开电脑准备看看 Coursera 上面的算法,可是静不下心来,真的静不下心来!我尽力让自己平静,关掉了窗口,算了!刷题吧,连续点开了三道...

Read More

1-d range

​ 1d range 的问题主要就是讨论,在某两个符号之间存在多少个其他的符号。首先这里用到了二叉排序树,然后我们利用了二叉排序树的 rank 操作就能直接得到两个符号之间的 range 数

Read More

平衡搜索树

2-3树​ 其实仔细来看2-3树好像是 B 树的一个特例,它规定了一个节点要么有一个 key 要么有两个 key。 如果有一个 key 那么他就有两个子节点,左边小于这个 key 右边大于这个 key 如果有两个 key 那么他就有三个子节点,左边小于,中间处于两者之间,右边大于 ​ 这样一来就会发现他其实也会处在插入的时候出现分裂的情况,当一个节点需要插入的时候我们先让他插入,这时候可能出现一个节点有三个 key 的情况,我们就打出四个分支,然后我们把中间的那个 ...

Read More


Powered by Hexo and Hexo-theme-hiker

Copyright © 2015 - 2025 昨夜凛雨 All Rights Reserved.

UV : | PV :