Category Archives: Uncategorized

Software Developer — Aurora

https://www.amazon.jobs/en/jobs/1234156/software-developer-aurora

PREFERRED QUALIFICATIONS

· Database engine internals (storage): indexing, access methods, locking, logging, caching, transaction processing, replication, backup restore, buffer management
· Database engine internals (query processing): query compilation, optimization, execution, parallel execution
· Distributed systems: consensus-based quorum replication, NoSQL system implementation
· Candidates with strong backgrounds in file and storage systems, compilers, operating systems, networking, etc.are also encouraged to apply.
· OS internals.
· Low level performance and tuning.

装,你继续装

年轻人问道禅师:“我志向高洁,出淤泥而不染,无法容纳这个污秽的世界。”

禅师拿出一个袋子让年轻人把屋子里的垃圾装进去,年轻人很快就装满了。

禅师又拿出一个袋子。

年轻人恍然大悟:“您是说只要有足够宽广的胸怀,就能容纳这个世界?”

禅师摇摇头,指着袋子说:“装,你继续装。”

绿卡排期

https://travel.state.gov/content/travel/en/legal/visa-law0/visa-bulletin.html

2019.10 — 2015.1.1
2019.11 — 2015.3.15
2019.12 — 2015.6.22 (预计:2015.5.15)
2020.1   — 2015.7.1 (预计:2015.7.15)
2020.2   — 2015.7.15 (预计:2015.9.15)
2020.3   — 2015.8.15 (预计:2015.11.15)
2020.4   — 2015.9.1
2020.5   — 2015.10.1
2020.6   — 2015.11.1

我的排期:2015.10.18

单向链表倒转递归解法

我的解法:


struct node *revert_recursive(struct node *n, struct node **head)
{
struct node *tail;
struct node *tmp;

if (!n->next) {
tail = n;
*head = n;
return tail;
}

tail = revert_recursive(n->next, &tmp);
*head = tmp;
tail->next = n;
n->next = NULL;
return n; /* n is new tail */
}

我的思路是递归过程中要记录new head和tail.

但实际上当解决最小问题的时候知道head了,然后递归返回的时候也就传给父问题了: “return nh”

更妙的是tail不需要保存, head->next就是tail:这点很关键,我想不到。

别人的更漂亮的解法:


struct node *revert_recursive_2(struct node *head)
{
struct node *nh;

if (head == NULL || !head->next)
return head;

nh = revert_recursive_2(head->next);
head->next->next = head; /* head->next is tail */
head->next = NULL;

return nh;
}