# LeetCode 56. Merge Intervals

Given a collection of intervals, merge all overlapping intervals.For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18].public List merge(List intervals) {...

# LeetCode 91. Decode Ways

A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given an encoded message containing digits, determine the total number of w...

Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1” Return “100”.初始化tmp 每一位和tmp的值相加 tmp / 2为下一轮的tmp tmp % 2为该位应该填上的数 public String addBinary(String a,...

# LeetCode 54. Spiral Matrix

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example, Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ] You should...

# LeetCode 48. Rotate Image

You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note: You have to rotate the image in-place, which means you have to modify the input 2D matrix direct...

# LeetCode 104. Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.计算二叉树的最大深度，没什么好说的，记录一下 public int m...

# LeetCode 100. Same Tree

Given two binary trees, 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 same value.Example 1:Inp...

# LeetCode 46. Permutations

Given a collection of distinct numbers, return all possible permutations.For example, [1,2,3] have the following permutations:[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] 给出数列列...

# java 将数组转化为 二叉树

class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } private TreeNode createBinaryTreeByArray(Integer []array,int index)...

# LeetCode 102. Binary Tree Level Order Traversal

Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).For example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 /...

# LeetCode 279. Perfect Squares

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n.For example, given n = 12, return 3 because 12 = 4 + 4 + 4; given n = 13, return...

# LeetCode 120. Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [6,5,7],...

# LeetCode 101. Symmetric Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \ 3 4 4 3 But the...

# flume文件下沉 kafka相关命令

1.flume配置文件kfk.conf# Describe/configure the source a1.sources.r1.type = exec a1.sources.r1.command = tail -F /home/hadoop/tmp/test.txt# Describe the sink a1.sinks.k1.type = org.apache.flume.sink.kafka....

# Java中Comparable和Comparator区别小结

51条 共4页1 2 3 4 下一页 尾页
个人资料
• 访问：3481次
• 积分：466
• 等级：
• 排名：千里之外
• 原创：41篇
• 转载：9篇
• 译文：1篇
• 评论：0条
文章分类
评论排行