CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 9. Palindrome Number

Given an integer x, return true if x is a palindrome, and false otherwise. Example 1:Input: x = 121Output: trueExplanation: 121 reads as 121 from left to right and from right to left. Example 2:I
2020-01-16
#leetcode #java #javascript #two pointer #math #palindrome

[LeetCode] 589. N-ary Tree Preorder Traversal

Given the root of an n-ary tree, return the preorder traversal of its nodes’ values. Nary-Tree input serialization is represented in their level order traversal. Each group of children is separated by
2020-01-15
#leetcode #tree #dfs #java #preorder #n-ary tree

[LeetCode] 506. Relative Ranks

You are given an integer array score of size n, where score[i] is the score of the ith athlete in a competition. All the scores are guaranteed to be unique. The athletes are placed based on their scor
2020-01-14
#leetcode #java #array #bucket sort #heap

[LeetCode] 513. Find Bottom Left Tree Value

Given the root of a binary tree, return the leftmost value in the last row of the tree. Example 1:Input: root = [2,1,3]Output: 1 Example 2:Input: root = [1,2,3,4,null,5,6,null,null,7]Output:
2020-01-14
#leetcode #tree #bfs #dfs #java #javascript #preorder

[LeetCode] 102. Binary Tree Level Order Traversal

Given the root of a binary tree, return the level order traversal of its nodes’ values. (i.e., from left to right, level by level). Example 1:Input: root = [3,9,20,null,null,15,7]Output: [[3],[9,
2020-01-12
#leetcode #tree #bfs #java #preorder

[LeetCode] 145. Binary Tree Postorder Traversal

Given the root of a binary tree, return the postorder traversal of its nodes’ values. Example 1:Input: root = [1,null,2,3]Output: [3,2,1] Example 2:Input: root = []Output: [] Example 3:Input
2020-01-10
#leetcode #tree #dfs #java #postorder

[LeetCode] 94. Binary Tree Inorder Traversal

Given the root of a binary tree, return the inorder traversal of its nodes’ values. Example 1:Input: root = [1,null,2,3]Output: [1,3,2] Example 2:Input: root = []Output: [] Example 3:Input:
2020-01-10
#leetcode #tree #dfs #java #inorder

[LeetCode] 226. Invert Binary Tree

Given the root of a binary tree, invert the tree, and return its root. Example 1:Input: root = [4,2,7,1,3,6,9]Output: [4,7,2,9,6,3,1] Example 2:Input: root = [2,1,3]Output: [2,3,1] Example 3
2020-01-08
#leetcode #tree #bfs #dfs #java #preorder

[LeetCode] 100. Same Tree

Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the
2020-01-07
#leetcode #tree #bfs #dfs #java #javascript

[LeetCode] 104. Maximum Depth of Binary Tree

Given the root of a binary tree, return its maximum depth. A binary tree’s maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. Example 1:Inpu
2020-01-07
#leetcode #tree #dfs #java #postorder
1…3536373839…41

Search

Hexo Fluid