关闭
当前搜索:

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) {...
阅读(18) 评论(0)

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...
阅读(15) 评论(0)

LeetCode 67. Add Binary

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,...
阅读(23) 评论(0)

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...
阅读(19) 评论(0)

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...
阅读(26) 评论(0)

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...
阅读(16) 评论(0)

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...
阅读(13) 评论(0)

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] ] 给出数列列...
阅读(16) 评论(0)

java 将数组转化为 二叉树

class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } private TreeNode createBinaryTreeByArray(Integer []array,int index)...
阅读(31) 评论(0)

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 /...
阅读(24) 评论(0)

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...
阅读(27) 评论(0)

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],...
阅读(27) 评论(0)

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...
阅读(24) 评论(0)

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....
阅读(40) 评论(0)

Java中Comparable和Comparator区别小结

一、Comparable简介  Comparable是排序接口。若一个类实现了Comparable接口,就意味着该类支持排序。实现了Comparable接口的类的对象的列表或数组可以通过Collections.sort或Arrays.sort进行自动排序。  此外,实现此接口的对象可以用作有序映射中的键或有序集合中的集合,无需指定比较器。该接口定义如下:package java.lang; impo...
阅读(20) 评论(0)
51条 共4页1 2 3 4 下一页 尾页
    个人资料
    • 访问:3481次
    • 积分:466
    • 等级:
    • 排名:千里之外
    • 原创:41篇
    • 转载:9篇
    • 译文:1篇
    • 评论:0条
    文章分类