link on JianShu 栈stack 1047. Remove All Adjacent Duplicates In String Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. We repeatedly make duplicate removals on S until we no longer can. Return the final string after all such duplicate removals have been made. It is guaranteed the answer is unique. Example 1:
link on JianShu 栈stack 144. Binary Tree Preorder Traversal Medium Given a binary tree, return the preorder traversal of its nodes’ values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,2,3] Follow up: Recursive solution is trivial, could you do it iteratively? 前序就是根节点在最前根->左->
link on JianShu 栈stack 145. Binary Tree Postorder Traversal Hard Given a binary tree, return the postorder traversal of its nodes’ values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [3,2,1] Follow up: Recursive solution is trivial, could you do it iteratively? 后序遍历在访问完左子树向上回退到根节点的时候
link on JianShu 栈stack 844. Backspace String Compare Easy Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character. Example 1: Input: S = “ab#c”, T = “ad#c” Output: true Explanation: Both S and T become “ac”. Note: 1 <= S.length <= 200 1 <= T.length <= 200 S and T
link on JianShu 栈stack 94. Binary Tree Inorder Traversal Medium Given a binary tree, return the inorder traversal of its nodes’ values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Recursive solution is trivial, could you do it iteratively? 先了解一下 preorder (前序),inorder(中序)