脸熟实习面经

考了两题

  1. Construct a binary tree from preorder and inorder traversal
    https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
    I told him I had this question before. He did not let me explain it or anything. He just moved to the next question.
  2. Swap Nodes in Pairs with doubly linked list.
    https://leetcode.com/problems/swap-nodes-in-pairs/ 变种
    This is my weakness. I had no knowledge about Doubly Linked Lists & I could not do anything. I was totally lost even though I think this is an easy question. I shouldn’t be given this opportunity and just freaked out & could not do anything lol.
    Given: A->B->C->D
    Output: B->A->D->C