- 博客(201)
- 资源 (19)
- 问答 (1)
- 收藏
- 关注
转载 epoll详细工作原理
开发高性能网络程序时,windows开发者们言必称iocp,linux开发者们则言必称epoll。大家都明白epoll是一种IO多路复用技术,可以非常高效的处理数以百万计的socket句柄,比起以前的select和poll效率高大发了。我们用起epoll来都感觉挺爽,确实快,那么,它到底为什么可以高速处理这么多并发连接呢?先简单回顾下如何使用C库封装的3个epoll系统调用吧。
2015-04-29 14:35:19
740
原创 操作系统复习
1、段页式存储管理 http://blog.youkuaiyun.com/xiucaijiang/article/details/6818359 a.获得一条指令或数据,须三次访问内存b.优缺点c. 注意段表寄存器 越界判断2、
2015-04-16 14:43:47
617
转载 Linux netstat命令详解
Linux netstat命令详解简介Netstat 命令用于显示各种网络相关信息,如网络连接,路由表,接口状态 (Interface Statistics),masquerade 连接,多播成员 (Multicast Memberships) 等等。输出信息含义执行netstat后,其输出结果为Active Internet connections (w/o
2015-04-03 15:42:59
545
原创 (**leetcode_Array) 3Sum
3Sum Total Accepted: 48690 Total Submissions: 288511My SubmissionsQuestion Solution Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Fin
2015-04-02 11:30:23
519
原创 (*leetcode_Array)Find Minimum in Rotated Sorted Array
Find Minimum in Rotated Sorted Array Total Accepted: 35966 Total Submissions: 109229My SubmissionsQuestion Solution Suppose a sorted array is rotated at some pivot unknown to you
2015-04-01 20:28:24
442
原创 (*leetcode_位运算)Reverse Bits
Reverse Bits Total Accepted: 12352 Total Submissions: 45334My SubmissionsQuestion Solution Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (r
2015-04-01 19:47:22
465
原创 (*leetcode_DP)House Robber
House Robber Total Accepted: 1521 Total Submissions: 5492My SubmissionsQuestion Solution You are a professional robber planning to rob houses along a street. Each house has a cer
2015-04-01 17:36:06
885
原创 (**leetcode)Valid Sudoku
Valid Sudoku Total Accepted: 30727 Total Submissions: 112986My SubmissionsQuestion Solution Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku
2015-04-01 16:55:35
429
原创 (*leetcode_二进制位运算)Number of 1 Bits
Number of 1 Bits Total Accepted: 17377 Total Submissions: 47626My SubmissionsQuestion Solution Write a function that takes an unsigned integer and returns the number of ’1' bits
2015-04-01 15:59:57
633
原创 (*leetcode_LinkedList)Remove Nth Node From End of List
Remove Nth Node From End of List Total Accepted: 46314 Total Submissions: 166894My SubmissionsQuestion Solution Given a linked list, remove the nth node from the end of list and
2015-04-01 15:51:53
533
原创 (***leetcode_Math)Palindrome Number
Palindrome Number Total Accepted: 49532 Total Submissions: 168189My SubmissionsQuestion Solution Determine whether an integer is a palindrome. Do this without extra space.click
2015-04-01 15:34:56
434
原创 (***leetcode_stack)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
2015-04-01 14:58:56
513
原创 (***leetcode_Math)Factorial Trailing Zeroes
Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.Credits:Special thanks to @ts for adding this problem and creating
2015-04-01 12:39:13
478
原创 (**leetcode_LinkedList) Intersection of Two Linked Lists
Intersection of Two Linked Lists Total Accepted: 22543 Total Submissions: 81453My SubmissionsQuestion Solution Write a program to find the node at which the intersection of two s
2015-03-31 14:41:48
452
原创 *(leetcode_String) Compare Version Numbers
Compare Version Numbers Total Accepted: 17264 Total Submissions: 115888My SubmissionsQuestion Solution Compare two version numbers version1 and version2.If version1 > version2
2015-03-31 11:31:49
478
原创 **(leetcode_Array)Rotate Array
void rotate(int nums[], int n, int k) { if(k k=k%n; ////////////////////////注意 reverse(nums, 0, n-k-1); reverse(nums, n-k, n-1); reverse(nums, 0,
2015-03-30 09:43:18
371
转载 动态规划:从新手到专家
http://www.360doc.com/content/13/0601/00/8076359_289597587.shtml
2015-03-13 17:08:33
780
原创 **(leetcode_backtracking) Subsets II
Subsets II Total Accepted: 31198 Total Submissions: 113760My SubmissionsQuestion Solution Given a collection of integers that might contain duplicates, S, return all possible sub
2015-03-05 10:34:09
431
原创 **(leetcode_backtracking)Permutations
Permutations Total Accepted: 41857 Total Submissions: 131799My SubmissionsQuestion Solution Given a collection of numbers, return all possible permutations.For example,[1,2,3
2015-03-05 10:03:57
448
原创 ***(leetcode_backtracking) Word Search
Word Search Total Accepted: 29308 Total Submissions: 146478My SubmissionsQuestion Solution Given a 2D board and a word, find if the word exists in the grid.The word can be cons
2015-03-02 16:58:46
432
原创 **(leetcode_backtracking,递归) Gray Code
Gray Code Total Accepted: 28247 Total Submissions: 86700My SubmissionsQuestion Solution The gray code is a binary numeral system where two successive values differ in only one bi
2015-03-02 14:13:09
831
原创 ***(leetcode_backtracking) Generate Parentheses
Generate Parentheses Total Accepted: 30730 Total Submissions: 96094My SubmissionsQuestion Solution Given n pairs of parentheses, write a function to generate all combinations of
2015-01-12 10:47:22
553
原创 **(leetcode_backtracking) Combinations
Combinations Total Accepted: 29639 Total Submissions: 98037My SubmissionsQuestion Solution Given two integers n and k, return all possible combinations of k numbers out of 1 ...
2015-01-08 08:40:26
457
原创 ***(leetcode_backtracking) Combination Sum
Combination Sum Total Accepted: 28917 Total Submissions: 106458My SubmissionsQuestion Solution Given a set of candidate numbers (C) and a target number (T), find all unique combi
2015-01-07 09:37:32
395
原创 ***(leetcode_backtracking) Combination Sum II
Combination Sum II Total Accepted: 22298 Total Submissions: 90199My SubmissionsQuestion Solution Given a collection of candidate numbers (C) and a target number (T), find all uni
2014-12-31 10:24:47
688
转载 backtracking 算法讲解
Backtrackingbacktracking中文称做「回溯法」,穷举多维度数据的方法,可以想作是多维度的Exhaustive Search。大意是:把多维度数据看做是是一个多维向量(solution vector),然后运用递回依序递回穷举各个维度的值,制作出所有可能的数据(solution space),并且在递回途中避免列举出不正确的数据。 ba
2014-12-30 19:05:06
24451
原创 ***(leetcode_ backtracking) Subsets
Subsets Total Accepted: 32700 Total Submissions: 116832My SubmissionsQuestion Solution Given a set of distinct integers, S, return all possible subsets.Note:Elements in a
2014-12-30 11:00:05
530
原创 ****(leetcode_string) Decode Ways
Decode Ways Total Accepted: 24925 Total Submissions: 153233My SubmissionsQuestion Solution A message containing letters from A-Z is being encoded to numbers using the following
2014-12-30 09:37:40
411
原创 ***(leetcode_string) Letter Combinations of a Phone Number
Letter Combinations of a Phone Number Total Accepted: 24684 Total Submissions: 93313My SubmissionsQuestion Solution Given a digit string, return all possible letter combinations
2014-12-29 21:18:38
1397
转载 最长公共子串(连续)问题
动态规划有一个经典问题是最长公共子序列,但是这里的子序列不要求连续,如果要求序列是连续的,我们叫公共子串,那应该如何得到这个串呢?最简单的方法就是依次比较,以某个串为母串,然后生成另一个串的所有长度的子串,依次去母串中比较查找,这里可以采用先从最长的子串开始,减少比较次数,但是复杂度依然很高!然后重新看一下这个问题,我们建立一个比较矩阵来比较两个字符串str
2014-12-29 13:55:45
456
原创 *****(leetcode_string)Longest Palindromic Substring
Longest Palindromic Substring Total Accepted: 29287 Total Submissions: 141909My SubmissionsQuestion Solution Given a string S, find the longest palindromic substring in S. You ma
2014-12-29 10:35:30
532
原创 ***(leetcode_string) Multiply Strings
Multiply Strings Total Accepted: 19279 Total Submissions: 93810My SubmissionsQuestion Solution Given two numbers represented as strings, return multiplication of the numbers as a
2014-12-25 10:32:24
480
转载 sizeof与strlen的区别与联系
一、sizeof sizeof(...)是运算符,在头文件中typedef为unsigned int,其值在编译时即计算好了,参数可以是数组、指针、类型、对象、函数等。 它的功能是:获得保证能容纳实现所建立的最大对象的字节大小。 由于在编译时计算,因此sizeof不能用来返回动态分配的内存空间的大小。实际上,用sizeof来返回类型以及静态分配的对象、结构或数组所
2014-12-23 10:24:42
546
原创 ****(leetcode_string) Anagrams
Anagrams Total Accepted: 22587 Total Submissions: 94546My SubmissionsQuestion Solution Given an array of strings, return all groups of strings that are anagrams.Note: All input
2014-12-23 09:21:01
480
原创 **(leetcode_string) Restore IP Addresses
Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given "25525511135",return ["255.255.11.135", "255.255.111.35"]. (Order do
2014-12-18 10:45:10
360
原创 *(leetcode_string) Length of Last Word
Length of Last Word Total Accepted: 27622 Total Submissions: 95492My SubmissionsQuestion Solution Given a string s consists of upper/lower-case alphabets and empty space characte
2014-12-17 09:08:31
559
原创 *****(leetcode_string) Implement strStr() (KMP算法*****)
Implement strStr() Total Accepted: 29468 Total Submissions: 135898My SubmissionsQuestion Solution Implement strStr().Returns the index of the first occurrence of needle in hays
2014-12-16 09:43:42
1514
原创 *(leetcode_string) Longest Common Prefix
Longest Common Prefix Total Accepted: 26921 Total Submissions: 101490My SubmissionsQuestion Solution Write a function to find the longest common prefix string amongst an array of
2014-12-15 09:10:47
532
原创 **(leetcode_string) Count and Say
Count and Say Total Accepted: 24346 Total Submissions: 94623My SubmissionsQuestion Solution The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 2
2014-12-14 15:40:29
426
原创 *(leetcode_string) Add Binary
Add Binary Total Accepted: 25303 Total Submissions: 100950My SubmissionsQuestion Solution Given two binary strings, return their sum (also a binary string).For example,a = "1
2014-12-11 11:08:56
536
c++语言多项式求解 利用堆栈
2010-11-07
链表的基本操作:插入、删除、查找。c++语言实现
2010-10-31
C语言 结构体指针字符 二进制文件写入和读取 指针字符输出错误
2014-02-22
TA创建的收藏夹 TA关注的收藏夹
TA关注的人