归档 2015年1月

题目描述：

The Employee table holds all employees. Every employee has an Id, and there is also a column for the department Id.

```+----+-------+--------+--------------+
| Id | Name  | Salary | DepartmentId |
+----+-------+--------+--------------+
| 1  | Joe   | 70000  | 1            |
| 2  | Henry | 80000  | 2            |
| 3  | Sam   | 60000  | 2            |
| 4  | Max ...```

什么是Alexa排名？

Alexa排名反映了一个网站的受欢迎程度。最受欢迎的网站的Alexa排名为1。如果Alexa的排名为100,000，则说明这个网站是全球第100,000受欢迎的网站。通常人们提到的Alexa排名指的是全球排名，此外Alexa还有各个国家的网站排名。

Alexa的创始人是谁？

Alexa最早由两个合伙人创办于1996年，命名为Alexa互联网公司。名字的灵感来自于著名的亚历山大图书馆（Library of Alexandria）。他们基于用户的数据开发了一个为用户提供网站浏览推荐的“接下来去哪”的工具栏 ...

题目描述：

The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id.

```+----+-------+--------+--------------+
| Id | Name  | Salary | DepartmentId |
+----+-------+--------+--------------+
| 1  | Joe   | 70000  | 1            |
| 2  | Henry | 80000  | 2            |
| 3  | Sam   | 60000  | 2 ...```

题目描述：

Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anything.

Table: Customers.

```+----+-------+
| Id | Name  |
+----+-------+
| 1  | Joe   |
| 2  | Henry |
| 3  | Sam   |
| 4  | Max   |
+----+-------+
```

Table ...

题目描述：

Given a binary tree, return the postorder traversal of its nodes' values.

```For example:
Given binary tree {1,#,2,3},
1
\
2
/
3
return [3,2,1].```

Note: Recursive solution is trivial, could you do it iteratively?