![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
HELLO_蓝猫
这个作者很懒,什么都没留下…
展开
-
Leetcode 79. Word Search
79. Word SearchDescriptionHintsSubmissionsDiscussSolutionPick OneGiven a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell...原创 2018-03-09 11:26:46 · 110 阅读 · 0 评论 -
java servlet doget method
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dt原创 2018-06-06 16:58:08 · 195 阅读 · 0 评论 -
Leetcode 133. Clone Graph
提示:java的等于类似于C++的引用,递归调用图的时候,邻接表的存在可能导致节点相互访问导致栈溢出。https://zhidao.baidu.com/question/1638638436245534940.html/** * Definition for undirected graph. * class UndirectedGraphNode { * int label; *...原创 2018-06-22 14:47:48 · 186 阅读 · 0 评论 -
Leetcode 143. Reorder List
DescriptionHintsSubmissionsDiscussSolutionPick OneGiven a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You may not modify the values in the list's nodes, only nodes itse...原创 2018-06-26 13:17:02 · 118 阅读 · 0 评论 -
Leetcode 147. Insertion Sort List
解法:找一个代排序列,一个排好序列,然后一个个比较,插入正确位置,重要一点,没插入完一个元素要更新rear的next。Sort a linked list using insertion sort.A graphical example of insertion sort. The partial sorted list (black) initially contains only the fi...原创 2018-06-26 15:40:13 · 160 阅读 · 0 评论 -
Leetcode 155. Min Stack
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the ...原创 2018-06-27 09:50:19 · 144 阅读 · 0 评论 -
Leetcode 165. Compare Version Numbers
Compare two version numbers version1 and version2.If version1 > version2 return 1; if version1 < version2 return -1;otherwise return 0.You may assume that the version strings are non-empty an...原创 2018-07-17 14:49:15 · 120 阅读 · 0 评论 -
Leetcode 151. Reverse Words in a String
public class Solution { public String reverseWords(String s) { String []v=s.split(" "); /* for(String x:v) { System.out.println(x); }*/ String ans=""; for(int i=v.length-...原创 2018-07-05 21:02:14 · 204 阅读 · 0 评论 -
自定义注解提示:RetentionPolicy/ElementType cannot be resolved to a variable
在开发excle的通用导入导出功能,用到注解,报如下错误,包导入不进来RetentionPolicy cannot be resolved to a variableElementType cannot be resolved to a variable@Retention和@Target都能导入进来,没办法只能手动导入包了import java.lang.annotatio...转载 2018-07-20 17:16:55 · 3074 阅读 · 1 评论 -
java.util.Collections.reverse()方法实例
everse(List<?>) 方法被用来反转指定列表中的元素的顺序。声明以下是java.util.Collections.reverse()方法的声明。public static void reverse(List<?> list) 参数 list--这是一个列表,其元素将被扭转。 返回值NA异常 UnsupportedOp...转载 2018-08-14 12:01:35 · 2128 阅读 · 0 评论 -
Leetcode 199. Binary Tree Right Side View
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { int...原创 2018-08-28 17:15:13 · 113 阅读 · 0 评论 -
抽象类
比较区别编辑与具体类比较 抽象类不能直接实例化,并且对抽象类使用 new 运算符会导致编译时错误。虽然一些变量和值在编译时的类型可以是抽象的,但是这样的变量和值必须或者为 null,或者含有对非抽象类的实例的引用(此非抽象类是从抽象类派生的)。 允许(但不要求)抽象类包含抽象成员。 抽象类不能被密封。 与接口比较抽象类表示该类中可能已经有一些方法的...转载 2018-08-30 13:49:15 · 135 阅读 · 0 评论 -
socket编程 java实现
参考:https://blog.csdn.net/lucas_up/article/details/79751443https://www.cnblogs.com/wangcq/p/3520400.html 先从服务器端说起。服务器端先初始化Socket,然后与端口绑定(bind),对端口进行监听(listen),调用accept阻塞,等待客户端连接。在这时如果有个客户端初始化一个So...原创 2018-10-21 15:05:37 · 974 阅读 · 0 评论 -
Leetcode 113. Path Sum II
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { pri...原创 2018-05-08 14:45:52 · 157 阅读 · 0 评论 -
Leetcode 112. Path Sum
112. Path SumDescriptionHintsSubmissionsDiscussSolutionPick OneGiven 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...原创 2018-05-08 11:03:48 · 114 阅读 · 0 评论 -
Leetcode 94. Binary Tree Inorder Traversal
送分题 没什么说的Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree [1,null,2,3], 1 \ 2 / 3/** * Definition for a binary tree node. * pub...原创 2018-03-22 21:48:57 · 103 阅读 · 0 评论 -
equals的重写
package imooc;public class Course { public String id; public String name; public Course(String id,String name) { this.name=name; this.id=id; } @Override public boolean equals(Object ob...原创 2018-03-19 21:33:10 · 158 阅读 · 0 评论 -
Leetcode 86. Partition List
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */class Solution { public ListNode partition(L...原创 2018-03-20 14:31:07 · 152 阅读 · 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:In...原创 2018-04-02 13:26:35 · 102 阅读 · 0 评论 -
java的文件编程io流
package SYA;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException;public class Test{ public static void main(String[] args) throws IOEx...原创 2018-03-27 17:34:44 · 146 阅读 · 0 评论 -
Leetcode 98. Validate Binary Search Tree
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { int...原创 2018-03-29 16:07:04 · 117 阅读 · 0 评论 -
Leetcode 105. Construct Binary Tree from Preorder and Inorder Traversal
解法:1.先序中第一个是根 2.中序根据顶点分左右两枝 3.先序先访问顶点 中序先访问左字数原创 2018-04-20 16:48:49 · 106 阅读 · 0 评论 -
Leetcode 105. Construct Binary Tree from Preorder and Inorder Traversal
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { publ...原创 2018-04-25 16:56:37 · 108 阅读 · 0 评论 -
Leetcode 106. Construct Binary Tree from Inorder and Postorder Traversal
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution { //和上一...原创 2018-04-25 19:18:03 · 176 阅读 · 0 评论 -
Leetcode 107. Binary Tree Level Order Traversal II
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree [3,9,20,null,null,15,7], ...原创 2018-04-26 15:48:44 · 110 阅读 · 0 评论 -
Leetcode 108. Convert Sorted Array to Binary Search Tree
解法:永远以中点为根,左右划分,之后递归。将一个按照升序排列的有序数组,转换为一棵高度平衡二叉搜索树。本题中,一个高度平衡二叉树是指一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过 1。示例:给定有序数组: [-10,-3,0,5,9],一个可能的答案是:[0,-3,9,-10,null,5],它可以表示下面这个高度平衡二叉搜索树: 0 / \ -3 ...原创 2018-04-26 16:51:57 · 128 阅读 · 0 评论 -
Leetcode 109. Convert Sorted List to Binary Search Tree
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } *//** * Definition for a binary tree node. * pub...原创 2018-05-04 14:06:35 · 127 阅读 · 0 评论 -
LeetCode 110. Balanced Binary Tree
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */class Solution{ publ...原创 2018-05-04 15:19:23 · 123 阅读 · 0 评论 -
jeesite部署出错
严重: Error configuring application listener of class com.thinkgem.jeesite.modules.sys.listener.WebContextListener解决方法:把pom.xml里面的jdk版本改成和eclipse的jdk版本一样的。...原创 2019-01-04 15:47:05 · 589 阅读 · 0 评论