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

Leetcode 536. Construct Binary Tree from String

You need to construct a binary tree from a string consisting of parenthesis and integers.

The whole input represents a binary tree. It contains an integer followed by zero, one or two pairs of parenthesis. The integer represents the root’s value and a pair of parenthesis contains a child binary tree with the same structure.

You always start to construct the left child node of the parent first if it exists.

Example:
Input: "4(2(3)(1))(6(5))"
Output: return the tree root node representing the following tree:

       4
     /   \
    2     6
   / \   / 
  3   1 5

 

Note:
There will only be ‘(‘, ‘)’, ‘-‘ and ‘0’ ~ ‘9’ in the input string.
An empty tree is represented by “” instead of “()”.

/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
 * };
 */
class Solution {
public:
    TreeNode* str2tree(string s) {
        int i = 0;
        return dfs(s, i);
    }

    int get_next_num(string &s, int &i) {
        int start = i;
        while (i != (int)s.size() && s[i] != '(' && s[i] != ')')
            i++;

        return stoi(s.substr(start, i - start));
    }
/*
 0123456789
 4(2(3)(1))(6(5))

 4(2)(3)

*/
    TreeNode *dfs(string &s, int &i) {
        //base case
        int size = s.size();
        if (i >= size || s[i] == ')')
            return NULL;

        if (s[i] == '(')
            i++;

        int num = get_next_num(s, i);
        TreeNode *root = new TreeNode(num);

        TreeNode *left = dfs(s, i);
        TreeNode *right = dfs(s, i);

        root->left = left;
        root->right = right;

        if (s[i] == ')')
            i++;

        return root;
    }
};

 

 

像大佬一样

Nothing in this world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination alone are omnipotent. The slogan Press On! has solved and always will solve the problems of the human race