关闭

[置顶] n划分为1,2,3等等(动态规划)

package bd_algo;import java.util.Scanner;public class coin { public static void main(String[] args) { Scanner in = new Scanner(System.in); int[] coins = {0, 1, 2, 3}; while...
阅读(89) 评论(0)

[置顶] 华为笔试——字符集合

package 字符集合;import java.util.HashMap; import java.util.Scanner;/** * Created by h on 16-12-28. */ public class Main { public static void main(String[] args) { Scanner in = new Scanner(Sys...
阅读(1528) 评论(0)

[置顶] lintcode-->玩具工厂

package 玩具工厂;/** * Your object will be instantiated and called as such: * ToyFactory tf = new ToyFactory(); * Toy toy = tf.getToy(type); * toy.talk(); */ interface Toy { void talk(); }class Do...
阅读(732) 评论(0)

leetcode-118. Pascal's Triangle

func generate(numRows int) [][]int { var arr [][] int; arr = make([][]int, numRows); var i, j int; for i = 0; i < numRows; i++ { arr[i] = make([]int, i + 1); for j = 0; j...
阅读(57) 评论(0)

lintcode-二叉树中查找区间

/** * Definition of TreeNode: * public class TreeNode { * public int val; * public TreeNode left, right; * public TreeNode(int val) { * this.val = val; * this.left =...
阅读(37) 评论(0)

leetcode-最接近0的子数组和

public class Solution { /** * @param nums: A list of integers * @return: A list of integers includes the index of the first number * and the index of the last number *...
阅读(54) 评论(0)

lintcode-bitswap

package bd_algo;public class bit_tran { public static void main(String[] args) { System.out.println(bitSwapRequired(1, -1)); } public static int bitSwapRequired(int a, int b) {...
阅读(39) 评论(0)

lintcode括号匹配

package bd_algo;import java.util.HashMap; import java.util.Map; import java.util.Stack;/** * Created by Administrator on 2017/8/29. */ public class bracketsMatch { public static void main(String[...
阅读(66) 评论(0)

lintcode-最后一个单词的长度

package bd_algo;import java.util.LinkedHashMap;/** * Created by Administrator on 2017/8/29. */ public class LengthOfWord { public static void main(String[] args) { LinkedHashMap map = new...
阅读(30) 评论(0)

leetcode-lintcode-LRU缓存

package bd_algo;import java.util.LinkedHashMap; import java.util.Map;/** * Created by Administrator on 2017/8/29. */ public class LRUCache { public static void main(String[] args) { } int...
阅读(54) 评论(0)

快排

package bd_algo;/** * Created by Administrator on 2017/8/28. */ public class QS { public static void main(String[] args) { int[] nums = {3, 2, 1, 5, 4}; quickSort(nums); fo...
阅读(34) 评论(0)

lintcode-矩阵归零

package bd_algo;import java.util.ArrayList;/** * Created by Administrator on 2017/8/29. */ class MyPoint { int x; int y; MyPoint(int x, int y) { this.x = x; this.y = y;...
阅读(38) 评论(0)

几个有用的vim命令

1.搜索,查找 :/ 或者 :? ,下一个是n 2.全局替换 :1,$s/old/new/g...
阅读(97) 评论(0)

hihocoder1121

import java.util.*;enum Color{ no, white, black }class Node{ private Color color; private int id; List dateIds = new ArrayList<>(); Node(int id){ this.id = i...
阅读(39) 评论(0)

hihocoder1066-并查集

package com.snnu;import java.util.HashMap; import java.util.Scanner;public class union_find { static int maxn = 100000; static int[] disjointSet = new int[maxn]; static int len; static...
阅读(38) 评论(0)

安装完ubuntu后的一系列配置

由于每次安装完ubuntu后都要重新安装一次各种软件和一系列操作,有些软件的目录记不住,索性直接写在这里,以后安装的时候就按照这个目录结构 1.更新阿里源阿里云更新源2.软件安装包下载位置 ~/Desktop/study/soft_package 3.虚拟机联网不能解决的方法 联网 3.安装jdk安装jdk 安装在/opt/jdk/目录下面...
阅读(44) 评论(0)

链表求和问题

package add_list; // Definition for singly-linked list. class ListNode { int val; ListNode next; ListNode(int x) { val = x; } }public class Solution { public ListNode addTwoN...
阅读(96) 评论(0)

语法分析-1

网易云课堂编译原理作业 作业题目的链接地址#include #include #include void parse_F(); void parse_T(); void parse_E(); void error (char *want, char got);int i; char *str = 0;void error (char *w...
阅读(60) 评论(0)

使用数组实现堆排序

package com.snnu; public class HeapSort { public static void main(String[] args) { int[] arr = {3, 2, 6, 5, 7, 8}; int len = arr.length; int[] heap = new int[len]; h...
阅读(82) 评论(0)

当前排列的下一个排列(leetcode31)

package com.snnu;import java.util.Arrays;/** * Created by torch on 2017-06-02. */ public class Permutation { public void nextPermutation(int[] nums) { int len = nums.length; if(le...
阅读(59) 评论(0)

对链表排序

package com.snnu;import java.util.Random;/** * Created by torch on 2017-06-03. */ class ListNode { int val; ListNode next; ListNode(int x) { val = x; next = null; } }pu...
阅读(52) 评论(0)

linux下如何查看网卡的流量

命令如下: watch -n 1 “ifconfig enp3s0 | grep bytes”...
阅读(75) 评论(0)
183条 共10页1 2 3 4 5 ... 下一页 尾页
    个人资料
    • 访问:28809次
    • 积分:2023
    • 等级:
    • 排名:千里之外
    • 原创:182篇
    • 转载:1篇
    • 译文:0篇
    • 评论:4条
    最新评论