Nameless Site

But one day, you will stand before its decrepit gate,without really knowing why.

0%

来源Leetcode第199题二叉树的右视图

给定一棵二叉树,想象自己站在它的右侧,按照从顶部到底部的顺序,返回从右侧所能看到的节点值。

Read more »

来源Leetcode第129题求根到叶子节点数字之和

给定一个二叉树,它的每个结点都存放一个 0-9 的数字,每条从根到叶子节点的路径都代表一个数字。

Read more »

来源Leetcode第138题复制带随机指针的链表

给定一个链表,每个节点包含一个额外增加的随机指针,该指针可以指向链表中的任何节点或空节点。

要求返回这个链表的深拷贝

Read more »

来源Leetcode第113题路径总和II

给定一个二叉树和一个目标和,找到所有从根节点到叶子节点路径总和等于给定目标和的路径。

Read more »

这里就要区分一下标准库函数和系统调用了。

系统调用是内核提供给上层程序的接口,能够实现内核和上层之间的交互,系统调用在内核中的实现是软中断的方式,通过相应的中断服务例程来实现,

Read more »

来源POJ第1700题Crossing River

Description

A group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement must be arranged in order to row the boat back and forth so that all people may cross.

Read more »

来源POJ第3579题Median

Description

Given N numbers, X1, X2, … , XN, let us calculate the difference of every pair of numbers: ∣Xi - Xj∣ (1 ≤ ijN). We can get C(N,2) differences through this work,

Read more »