- 博客(13)
- 资源 (3)
- 收藏
- 关注
原创 CountofSmallerNumbers【LeetCode】
import java.util.*;public class CountofSmallerNumbersAfterSelf{ int []count; public int[] countSmaller(int[] nums) { count = new int[nums.length]; int []indexes = new int[nums.length]; for(i
2016-09-30 02:26:54
389
原创 Java实现文件拷贝
package com.knight.file;import java.io.*;public class Demo02 { public static void main(String[] args) { File src=new File("E:/java_mr/test"); File dest=new File("E:/java_mr/copy"); copyDir(
2016-09-20 10:35:59
313
原创 Java HttpServer实现交互
package com.knightsight.server;import java.net.*;import java.util.*;import java.io.*;public class Server2 { private ServerSocket server; public static final String CRLF="\r\n"; public static f
2016-08-22 08:40:54
2961
原创 Inorder/PostorderTraversal【LeetCode】
import java.util.*;public class BinaryTreeTraversal{ public static class TreeNode{ public int key; TreeNode lchild; TreeNode rchild; public TreeNode(int key){ this.key=key; this.lchild
2016-08-01 15:50:03
358
原创 Java TCP客户端服务器端交互
package com.knightsight.chatroom;import java.net.*;import java.io.*;/* * 输入流与输出流独立,客户端程序 */public class Client { public static void main(String[] args) throws IOException,UnknownHostException{
2016-07-24 08:51:51
414
原创 JS 常用TIP 测试输入合法性【HTML/JS】
测试数字function myFunction(){try{ var x=document.getElementById("demo").value;if(x=="") throw "值为空";if(isNaN(x)) throw "不是数字";if(x>10) throw "太大";if(x<5) throw "太小";}catch(e
2016-07-21 14:25:37
549
原创 JavaUDP 实现基本通信
import java.io.*;import java.net.*;public class ServerAndClient{ public static void main(String []args)throws SocketException,IOException{ //1.服务器端口 2.接收容器 3.封装成packet 4.分析释放数据 DatagramSocke
2016-07-20 21:43:57
521
原创 Java网页爬虫utf-8
import java.net.*;import java.io.*;public class MyURL{ public static void main(String []args)throws IOException{ URL url=new URL("http://inankai.cn/new/index.html"); BufferedReader br= new Bu
2016-07-17 13:39:29
393
原创 CSS实现竖排导航栏/图像选择【HTML/JS】
ul{list-style-type:none;margin:0;padding:0;}a:link,a:visited{display:block;font-weight:bold;color:#FFFFFF;background-color:#bebebe;width:120px;text-align:center;padding:4px;text-decorat
2016-07-15 14:37:36
7569
原创 AdditiveNumber【LeetCode】
public class AdditiveNumber{ public static boolean additiveNumber(String num){ for(int i=1;i<num.length()/2;i++){ for(int j=1;Math.max(i,j)<num.length()-i-j;j++) if(!isValid(i,j,num))return
2016-07-12 11:59:30
385
原创 Leet常用数据结构【LeetCode】
str.toCharArray();<br></br>str.charAt(index);Arrays.sort(chars);map.put(key,value);map.get(key);map.containsKey();for(String s:map.keySet())list.add("aa");list.get(i); list.size();
2016-07-12 08:25:32
978
原创 AddandSearchWordDatastructuredesign【LeetCode】
package leetcode;import java.util.LinkedList;import java.util.Queue;import leetcode.ImplementTriePrefixTree2.TrieNode;/* Design a data structure that supports the following two operations: * v
2016-07-11 11:06:39
334
原创 html/css_1基础【HTML/JS】
firstpagediv#container{width:800px}div#drinks{width:500px;height:400px;background-image:url('Desert.jpg');float:left;}div#webpages{width:300px;height:400px;float:left;}div#forms{float:left;b
2016-07-06 16:36:10
401
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人