CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 451. Sort Characters By Frequency

Given a string s, sort it in decreasing order based on the frequency of characters, and return the sorted string. Example 1:Input: s = “tree”Output: “eert”Explanation: ‘e’ appears twice while ‘r’
2020-01-23
#leetcode #hashmap #java #sort #bucket sort #string #heap

[LeetCode] 138. Copy List with Random Pointer

A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null. Construct a deep copy of the list. The deep copy shoul
2020-01-18
#leetcode #hashmap #java #javascript #linked list

[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 #two pointer #java #javascript #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 #java #tree #dfs #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 #array #java #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 #java #javascript #tree #bfs #dfs #preorder

[LeetCode] 113. Path Sum II

Given the root of a binary tree and an integer targetSum, return all root-to-leaf paths where the sum of the node values in the path equals targetSum. Each path should be returned as a list of the nod
2020-01-12
#leetcode #java #javascript #tree #dfs #preorder #recursion #backtracking

[LeetCode] 112. Path Sum

Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum. A leaf is a node with no c
2020-01-12
#leetcode #java #javascript #tree #bfs #dfs #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 #java #tree #bfs #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 #java #tree #dfs #postorder
1…3839404142…44

Search

Hexo Fluid