自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(52)
  • 资源 (6)
  • 收藏
  • 关注

原创 287. Find the Duplicate Number

Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number, fin

2016-08-31 08:24:52 399

原创 112. Path Sum

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 = 2

2016-08-30 22:41:17 368

原创 328. Odd Even Linked List

Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.You should try to do it in plac

2016-08-30 08:01:13 410

原创 318. Maximum Product of Word Lengths

Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case lette

2016-08-29 22:33:15 418

原创 389. Find the Difference

Given two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter at a random position.Find the letter that was added in

2016-08-29 08:09:47 626

原创 12. Integer to Roman

Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.Subscribe to see which companies asked this question就是找规律public class Solution { public Str

2016-08-27 14:11:09 467

原创 238. Product of Array Except Self

Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O(n).For e

2016-08-26 20:47:03 493

原创 384. Shuffle an Array

Shuffle a set of numbers without duplicates.Example:// Init an array with set 1, 2, and 3. int[] nums = {1,2,3}; Solution solution = new Solution(nums);// Shuffle the array [1,2,3] and return its res

2016-08-26 08:44:03 574

原创 343. Integer Break

Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.For example, given n = 2, return 1

2016-08-25 22:33:01 338

原创 319. Bulb Switcher

题目大意是,有n只初始处于关闭状态的灯泡。你首先打开所有的灯泡(第一轮)。然后,熄灭所有序号为2的倍数的灯泡。第三轮,切换所有序号为3的倍数的灯泡(开着的就关掉,关着的就打开)。第n轮,你只切换最后一只灯泡。计算n轮之后还有几盏灯泡亮着。 先看看以下规律: 第1个灯泡:1的倍数,会改变1次状态: off -> on 第2个灯泡:1的倍数,2的倍数,会改变2次状态: off -> on -> o

2016-08-25 22:12:53 359

原创 357. Count Numbers with Unique Digits

Count Numbers with Unique Digits QuestionEditorial Solution My Submissions Total Accepted: 13025 Total Submissions: 29945 Difficulty: Medium Given a non-negative integer n, count all numbers with

2016-08-25 18:07:38 352

原创 347. Top K Frequent Elements

Given a non-empty array of integers, return the k most frequent elements.For example, Given [1,1,1,2,2,3] and k = 2, return [1,2].Note: You may assume k is always valid, 1 ≤ k ≤ number of unique ele

2016-08-25 16:56:05 366

原创 python Scapy 随心所欲撩tcp协议栈

1. 前言如果只需要研究Linux的tcp协议栈行为,只需要使用packetdrill就能够满足我的所有需求。packetdrill才是让我随心所欲地撩tcp协议栈。packetdrill的简单使用手册。然而悲剧的是,除了要研究Linux的TCP协议栈行为,还需要研究Windows的tcp协议栈的行为,Windows不开源,感觉里面应该有挺多未知的坑。为了能够重现Windows的tcp协议栈的一些网

2016-08-25 00:25:14 18024

原创 Linux TCP 协议栈数据流走读

1. 综述Linux的TCP协议非常复杂,看了几天Linux内核的tcp实现犹如雾里看花。在这里主要是根据书籍《The Linux Networking Architecture》 24章,以及结合网上的资料,走读一遍tcp协议的数据流的发送和接收。而内核源码是Centos 7.2的标准内核3.10。这个版本和书中的介绍的函数有点不一样。tcp的数据流就是tcp数据的发送和接收两个方面。具体的系统调

2016-08-24 22:34:39 4896

原创 268. Missing Number

Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array.For example, Given nums = [0, 1, 3] return 2.Note: Your algorithm should run in line

2016-08-24 21:40:17 348

原创 338. Counting Bits

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array.Example: For num = 5 you sh

2016-08-24 08:28:27 346

原创 260. Single Number III

Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:Given nums = [1,

2016-08-23 21:15:24 372

原创 167. Two Sum II - Input array is sorted

Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers suc

2016-08-23 20:34:11 312

原创 9. Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Subscribe to see which companies asked this question解题思路:思路1:将整数转化成字符串,然后对比。这个需要额外的空间。思路2: 就是分别从两端取得数字,然

2016-08-23 07:57:22 392

原创 172. Factorial Trailing Zeroes

Given an index k, return the kth row of the Pascal’s triangle.For example, given k = 3, Return [1,3,3,1].Note: Could you optimize your algorithm to use only O(k) extra space?Subscribe to see which co

2016-08-23 07:37:40 280

原创 119. Pascal's Triangle II

Given an index k, return the kth row of the Pascal’s triangle.For example, given k = 3, Return [1,3,3,1].Note: Could you optimize your algorithm to use only O(k) extra space?Subscribe to see which co

2016-08-22 23:58:52 276

原创 387. First Unique Character in a String

Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1.Examples:s = “leetcode” return 0.s = “loveleetcode”, return 2. Note: You may assume

2016-08-22 22:18:16 839

原创 读《张爱玲:她从海上来》有感

这本书讲述了张爱玲的生平故事以及在她人生出现的几个重要人物。在这本书上可以深刻体会到张爱玲的人生是多么的曲折传奇。无论是人物铺排还是在穿插各种小故事,都可以深入理解张爱玲这个人物的特质。主线是以张爱玲的成长为主,生活环境转移为辅。1. 南京这里主要讲述张爱玲的父辈的生活。张爱玲系出名门,祖父张佩纶是清末名臣,祖母李菊耦是朝廷重臣李鸿章的长女。祖父为了躲避了朝廷的纷争,隐居于南京。故事从这里开始。在

2016-08-20 07:45:21 1049

原创 58. Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string.If the last word does not exist, return 0.Note: A word is defined as

2016-08-20 07:06:20 287

原创 118. Pascal's Triangle

Given numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5, Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ] Subscribe to see which compan

2016-08-19 22:18:11 277

原创 88. Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note: You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold additional

2016-08-19 08:10:57 275

原创 67. Add Binary

Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1” Return “100”.Subscribe to see which companies asked this question解题思路:用0补齐最短字符串左侧,至两字符串等长,如 a = “1111”

2016-08-18 08:42:45 255

原创 28. Implement strStr()

Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Subscribe to see which companies asked this question解题思路:这道题是一个字符串在另外一个字符串中的第

2016-08-17 21:35:35 262

原创 198. House Robber

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses

2016-08-17 19:03:51 296

原创 13. Roman to Integer

Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.Subscribe to see which companies asked this question解题思路: 根据罗马数字的规律,这个数字,小于等于左边的数字,表示需要+,而大于左边的

2016-08-17 13:10:27 314

原创 349. Intersection of Two Arrays

Given two arrays, write a function to compute their intersection.Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Note: Each element in the result must be unique. The result can be in

2016-08-17 08:41:28 232

原创 350. Intersection of Two Arrays II

Given two arrays, write a function to compute their intersection.Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Note: Each element in the result should appear as many times as it

2016-08-17 08:06:48 240

原创 371. Sum of Two Integers

Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example: Given a = 1 and b = 2, return 3.Credits: Special thanks to @fujiaozhu for adding this problem a

2016-08-16 21:01:50 299

原创 Packetdrill 简明使用手册

1. Packetdrill 编译与安装源码链接 https://github.com/google/packetdrill.git源码编译注释netdev.c/* Set the offload flags to be like a typical ethernet device */static void set_device_offload_flags(struct local_ne

2016-08-16 09:07:10 4139

原创 226. Invert Binary Tree

Invert a binary tree.4/ \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 Trivia: This problem was inspired by this original tweet by Max Howell: Goo

2016-08-16 08:11:21 332

原创 7、Java类集

1. 类集框架主要接口在整个Java类集中最常使用的类集接口是:Collection:是存放一组单值的最大父接口,所谓的单值是指集合中的每个元素都是一个对象。List:是Collection接口的子接口,也是最常用的接口。Set:是Collection接口的子类,没有对Collection接口进行扩展,不允许存放重复内容。Map:是存放一对值的最大父接口,即接口中的每个元素都是一对,以key

2016-08-15 22:42:05 574

原创 6、Java 常用类库

1. StringBuffer类String的内容一旦声明则不可改变,如果要改变,则改变的肯定是String的引用地址,那么如果现在的情况是一个字符串要被经常改变,此时就必须使用StringBuffer类,通过append()方法进行字符串的连接。常见用法如下所示:public StringBuffer() //StringBuffer构造方法public StringBuffer append(

2016-08-15 22:24:37 422

原创 5、Java泛型

1. 泛型的基本应用泛型可以解决数据类型的安全性问题,其主要原理是在类声明时通过一个标识表表示类中某个属性的类型或者某个方法的返回值及参数类型。这样在类声明或者实例化时只要制定好需要的具体的类型即可。class Notepad<K,V>{ private K key; private V value; public K getKey(){ return key;

2016-08-15 22:07:09 376

原创 4、Java 包及访问控制权限

1. 系统常见包java.lang 此包为基本的包,String,Inter等等常用类都保存在此包中java.lang.reflect 此包为反射机制的包,是java.lang的子包,在Java反射机制会介绍。java.util 此包为工具包,一个常用的类库,日期操作等在此包中,如果把此包掌握精要。java.text 提供了一些常用的类库、日期操作等在此包中。java.sql 数据库操作包

2016-08-15 21:58:32 407

原创 3、Java 异常的捕获及处理

1. 异常类的继承结构在整个Java的异常结构中,实际上有两个最常见的类,分别是Excepttion和Error,这两个类全都是Throwable的子类。Exception:一般表示的是程序中出现的问题,可以直接使用try…catch处理。Error:一般指的JVM的错误,程序中无法处理。一般情况下,开发者习惯于将Excepttion和Error统称为异常,而算术异常、数字格式化异常等都属于Exce

2016-08-15 21:54:53 788

jdk-8u111-linux-x64.zip

jdk-8u111-linux-x64.tar.gz.

2019-06-10

mysql-5.6.26.7z

mysql-5.6.26.tar.gz 下载下载.

2019-06-09

PaperTest Q&A

这是北邮师兄共享的面试经验总结。谢谢大家。

2014-08-22

TCP-IP详解卷1

这本书是学习TCP/IP协议的经典,是初学者学习的最好的入门资料。

2012-06-27

嵌入式WEB服务器及远程测控应用详解

重点描述了在嵌入式Linux系统上搭建Web服务器,通过Web的方式控制和检测资源。物联网。

2012-06-27

Java学习手册光盘

里面的资源很全,代码很实用。对学习Java编程的人,很实用。

2012-03-07

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除