`
zhang_xzhi_xjtu
  • 浏览: 536327 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论
文章列表
    public class Solution {         public int singleNumber(int[] A) {             int[] tem = new int[32];             for (int a : A) {                 int x = 1;                 for (int t = 0; t < 32; t++) {                     if (((x << t) & a) != 0) {                         tem[t ...
        public int[] searchRange(int[] A, int target) {             if (A == null || A.length == 0) {                 return new int[] { -1, -1 };             }             int start = start(A, target);             if (start == -1) {                 return new int[] { -1, -1 };             }        ...
package leetcode; /** * <pre> * Implement int sqrt(int x). * * Compute and return the square root of x. * </pre> * */ public class SqrtX {     public static class Solution {         public int sqrt(int x) {             long start = 0;             long end = (long) Integer.MAX_VAL ...
package leetcode; /** * * <pre> * Given a binary tree, find its minimum depth. * * The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. * </pre> * */ public class MinimumDepthofBinaryTree {     public class TreeNod ...
package t; /** * <pre> * Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). * * For example, this binary tree is symmetric: * *     1 *    / \ *   2   2 *  / \ / \ * 3  4 4  3 * But the following is not: *     1 *    / \ *   2   2 *  ...
package t; import java.util.ArrayList; import java.util.List; /** * <pre> * Given a binary tree, determine if it is a valid binary search tree (BST). * * Assume a BST is defined as follows: * * The left subtree of a node contains only nodes with keys less than the node's key. * The r ...
package leetcode; import java.util.Stack; /** * <pre> * Given an input string, reverse the string word by word. * * For example, * Given s = "the sky is blue", * return "blue is sky the". * </pre> */ public class ReverseWordsinaString {     public class Sol ...
/** * <pre> * There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. * * You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its next station (i+1). You begin the journey with an empty tank at one of th ...
package leetcode; /** * <pre> * Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. * * For example: * Given the below binary tree and sum = 22, *               5 *              / \ *      ...
package leetcode; /** * <pre> * Implement pow(x, n). * </pre> */ public class PowXN {     public static class Solution2 {         public double pow(double x, int n) {             if (n < 0) {                 n = -n;                 x = 1 / x;             }             double resu ...
package leetcode; import leetcode.tag.NeedStudyMore; @NeedStudyMore /** * <pre> * Given a binary tree * * struct TreeLinkNode { *   TreeLinkNode *left; *   TreeLinkNode *right; *   TreeLinkNode *next; * } * Populate each next pointer to point to its next right node. * If there is ...
package leetcode; /** * <pre> * Given a sorted linked list, delete all duplicates such that each element appear only once. * * For example, * Given 1->1->2, return 1->2. * Given 1->1->2->3->3, return 1->2->3. * </pre> */ public class RemoveDuplicatesfr ...
package leetcode; import java.util.Stack; /** * <pre> * Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. * * The brackets must close in the correct order, "()" and "()[]{}" are all valid but "( ...
simplehbase介绍文章如下: https://github.com/zhang-xzhi/simplehbase/wiki/C00-simplehbase-3%E5%88%86%E9%92%9F%E7%AE%80%E4%BB%8B github https://github.com/zhang-xzhi/simplehbase/ https://github.com/zhang-xzhi/simplehbase/wiki Data Object需要被simpleHbase识别,目前有3种方式来配置JOPO方式。 simplehbase在v0.9(包含v0.9)之前对于POJO的 ...
package leetcode; /** * <pre> * Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. * * Note: You can only move either down or right at any point in time. * </pre> * */ public class M ...
Global site tag (gtag.js) - Google Analytics