- 博客(130)
- 资源 (1)
- 收藏
- 关注
转载 JAVA线程同步中wait()和notify()简洁例子
JAVA线程同步中wait()和notify()简洁例子 搞懂这两个的用法之前,请你务必搞懂线程同步的道理,否则,下面这一大篇你应该是看不懂的。wait()和notify()一系列的方法,是属于对象的,不是属于线程的。它们用在线程同步时,synchronized语句块中。我们都知道,在synchronized语句块中,同一个对象,一个线程在执行完这一块代码之前,另一个线程,如果传进来
2015-07-27 13:08:01
641
转载 Android触摸机制
在Android中,事件主要包括点按、长按、拖拽、滑动等,点按又包括单击和双击,另外还包括单指操作和多指操作。所有这些都构成了Android中得事件响应。总的来说,所有的事件都由如下三个部分作为基础:按下(ACTION_DOWN)移动(ACTION_MOVE)抬起(ACTION_UP)所有的操作事件首先必须执行的是按下操作(ACTION_DOWN),之后所有的操作都是以
2015-07-26 00:20:22
593
原创 MFC学习记录
错误: error C2664: 'int CListCtrl::InsertColumn(int,LPCTSTR,int,int,int)' : cannot convert argument 2 from 'const char [3]' to 'LPCTSTR'解决方法: pList->InsertColumn(0, _T("工号"), 0, 100); pList->InsertC
2015-06-17 21:30:00
757
原创 Android_照相机Camera_调用系统照相机返回data为空
Android_照相机Camera_调用系统照相机返回data为空 有的手机,在拍照调用Intent过程中,activity的跳转,会把原来activity的一些参数,尤其是涉及到拍照的路径等的参数给pass掉,这样获取的也许就是为null了,所以要把中间的一些变量都要保存下来,可以使用static,同时注意横竖屏。因为有些手机不管你自己保不保存,它都会按照手机自身的设置来保存
2015-06-14 22:27:53
661
原创 select的理解
所谓文件描述符,就是你用来表示输入输出对象的整数,例如打开的文件以及网络通信用的套接字等。文件描述符的数量也是有限的,在Linux默认下,一个进程所能打开的文件描述符最大是1024个。用单线程来处理多个连接的时候,像等待套接字收到数据的过程,这种阻塞是致命的,为了避免阻塞,我们必须在读取数据前先检查文件描述符中的输入是否已经达到并可用。在unix中,对于多个文件描述符,可以使用一个叫做se
2015-05-26 17:33:11
586
原创 C++/PHP面经回馈学弟学妹(新浪阿里百度同花顺华为)
98转:http://www.cc98.org/dispbbs.asp?boardID=235&ID=4427297&page=[经验]C++/PHP面经回馈学弟学妹(新浪阿里百度同花顺华为)我属于最普通的那类学生,简历里基本没有任何能拿得出手的东西,奖学金没有,PAT没有,数学建模、ACM和我更没关系,在孙学长和朱学长的指点下,也算找到了令自己满意的工作,也希望能帮助和我一样需要帮助
2015-05-14 09:13:48
1329
转载 struct sockaddr与struct sockaddr_in ,struct sockaddr_un的区别和联系
http://www.cnblogs.com/hnrainll/archive/2011/04/24/2026432.htmluct sockaddr与struct sockaddr_in ,struct sockaddr_un的区别和联系在linux环境下,结构体struct sockaddr在/usr/include/linux/socket.h中定义,具体
2015-05-10 13:40:46
436
原创 Posts Tagged 【list】Reverse Linked List
Reverse Linked List Total Accepted: 4127 Total Submissions: 11587My SubmissionsQuestion Solution Reverse a singly linked list./** * Definition for singly-linked list. * publi
2015-05-07 10:18:23
411
原创 Posts Tagged 【hashMap && Double Linked List】LRU Cache
LRU Cache Total Accepted: 37708 Total Submissions: 253143My SubmissionsQuestion Solution Design and implement a data structure for Least Recently Used (LRU) cache. It should supp
2015-05-06 22:51:38
833
原创 Posts Tagged 【array && sort】Merge Intervals
Merge Intervals Total Accepted: 33631 Total Submissions: 150861My SubmissionsQuestion Solution Given a collection of intervals, merge all overlapping intervals.For example,Gi
2015-05-05 23:34:11
346
原创 Posts Tagged 【list && tree && dfs】Flatten Binary Tree to Linked List
Flatten Binary Tree to Linked List Total Accepted: 45579 Total Submissions: 158362My SubmissionsQuestion Solution Given a binary tree, flatten it to a linked list in-place.For
2015-05-05 10:11:27
396
原创 Posts Tagged 【math】Sudoku Solver
Sudoku Solver Total Accepted: 26308 Total Submissions: 121888My SubmissionsQuestion Solution Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are
2015-05-02 23:11:29
421
原创 Posts Tagged 【math】Valid Sudoku
Valid Sudoku Total Accepted: 33528 Total Submissions: 122751My SubmissionsQuestion Solution Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku
2015-05-02 15:22:50
365
原创 Posts Tagged 【math】Max Points on a Line
Max Points on a Line Total Accepted: 35386 Total Submissions: 287709My SubmissionsQuestion Solution Given n points on a 2D plane, find the maximum number of points that lie on th
2015-05-02 15:17:26
504
原创 Posts Tagged 【List】Anagrams
Anagrams Total Accepted: 34386 Total Submissions: 141041My SubmissionsQuestion Solution Given an array of strings, return all groups of strings that are anagrams.Note: All inpu
2015-05-02 00:00:26
419
原创 Posts Tagged 【String】 Isomorphic Strings
Isomorphic Strings Total Accepted: 2968 Total Submissions: 11949My SubmissionsQuestion Solution Given two strings s and t, determine if they are isomorphic.Two strings are isom
2015-05-01 21:52:51
472
原创 Posts Tagged 【tree && dfs】Sum Root to Leaf Numbers
Sum Root to Leaf Numbers Total Accepted: 42534 Total Submissions: 140130My SubmissionsQuestion Solution Given a binary tree containing digits from 0-9 only, each root-to-leaf p
2015-05-01 14:01:34
464
原创 Posts Tagged 【Catalan && dfs】Unique Binary Search Trees I && II
Unique Binary Search Trees Total Accepted: 47048 Total Submissions: 129376My SubmissionsQuestion Solution Given n, how many structurally unique BST's (binary search trees) that s
2015-05-01 10:54:33
475
原创 Posts Tagged 【bfs】Maximum && Minimum Depth of Binary Tree
Maximum Depth of Binary Tree Total Accepted: 62009 Total Submissions: 137555My SubmissionsQuestion Solution Given a binary tree, find its maximum depth.The maximum depth is the
2015-04-30 19:14:49
466
原创 Posts Tagged 【List】Swap Nodes in Pairs
Swap Nodes in Pairs Total Accepted: 45650 Total Submissions: 140545My SubmissionsQuestion Solution Given a linked list, swap every two adjacent nodes and return its head.For ex
2015-04-30 16:30:50
383
原创 Posts Tagged 【String】 Text Justification
Text Justification Total Accepted: 18124 Total Submissions: 125685My SubmissionsQuestion Solution Given an array of words and a length L, format the text such that each line has
2015-04-30 16:02:52
551
原创 Posts Tagged 【dp】Climbing Stairs
Climbing Stairs Total Accepted: 50798 Total Submissions: 148662My SubmissionsQuestion Solution You are climbing a stair case. It takes n steps to reach to the top.Each time you
2015-04-29 20:46:00
328
转载 SQL中Group By的使用
http://www.cnblogs.com/rainman/archive/2013/05/01/3053703.htmlSQL中Group By的使用1、概述2、原始表3、简单Group By4、Group By 和 Order By5、Group By中Select指定的字段限制6、Group By All7、Group By与聚合
2015-04-29 20:21:37
353
原创 Posts Tagged 【bit】Reverse Bits
Reverse Bits Total Accepted: 17853 Total Submissions: 64347My SubmissionsQuestion Solution Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (r
2015-04-27 23:54:27
363
原创 Posts Tagged 【bit】Number of 1 Bits
Number of 1 Bits Total Accepted: 24515 Total Submissions: 66387My SubmissionsQuestion Solution Write a function that takes an unsigned integer and returns the number of ’1' bits
2015-04-27 15:37:39
339
原创 Posts Tagged 【bit】Bitwise AND of Numbers Range
Bitwise AND of Numbers Range Total Accepted: 5165 Total Submissions: 19617My SubmissionsQuestion Solution Given a range [m, n] where 0 For example, given the range [5, 7], you
2015-04-27 15:33:38
465
原创 Posts Tagged 【math】Happy Number
Happy Number Total Accepted: 4647 Total Submissions: 14429My SubmissionsQuestion Solution Write an algorithm to determine if a number is "happy".A happy number is a number defi
2015-04-27 13:46:01
439
原创 Posts Tagged 【List】Remove Linked List Elements
Remove Linked List Elements Total Accepted: 4504 Total Submissions: 16723My SubmissionsQuestion Solution Remove all elements from a linked list of integers that have value val.
2015-04-27 13:02:30
351
原创 Posts Tagged 【math】Count Primes
Count Primes Total Accepted: 3 Total Submissions: 73My SubmissionsQuestion Solution Description:Count the number of prime numbers less than a non-negative number, nHint: The
2015-04-27 12:50:40
511
原创 Posts Tagged 【dfs】Number of Islands
Number of Islands Total Accepted: 5548 Total Submissions: 26482My SubmissionsQuestion Solution Given a 2d grid map of '1's (land) and '0's (water), count the number of islands.
2015-04-26 23:56:52
401
原创 Posts Tagged 【bfs】Binary Tree Level Order Traversal I && II
Binary Tree Level Order Traversal Total Accepted: 47754 Total Submissions: 161177My SubmissionsQuestion Solution Given a binary tree, return the level order traversal of its node
2015-04-26 22:21:02
372
原创 Posts Tagged 【String】 Reverse Words in a String
Reverse Words in a String Total Accepted: 60944 Total Submissions: 406484My SubmissionsQuestion Solution Given an input string, reverse the string word by word.For example,Gi
2015-04-25 18:38:08
351
原创 Posts Tagged 【dfs】Restore IP Addresses
Restore IP Addresses Total Accepted: 30274 Total Submissions: 145054My SubmissionsQuestion Solution Given a string containing only digits, restore it by returning all possible va
2015-04-25 15:11:33
409
原创 Posts Tagged 【dp】Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters Total Accepted: 59913 Total Submissions: 284544My SubmissionsQuestion Solution Given a string, find the length of the longest subst
2015-04-24 21:30:00
498
原创 Posts Tagged 【Arrays】 Median of Two Sorted Arrays
Median of Two Sorted Arrays Total Accepted: 46297 Total Submissions: 260023My SubmissionsQuestion Solution There are two sorted arrays nums1 and nums2 of size m and n respectivel
2015-04-24 16:49:28
693
原创 Posts Tagged 【List 】Reorder List
Reorder List Total Accepted: 37888 Total Submissions: 180454My SubmissionsQuestion Solution Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…
2015-04-23 23:50:57
439
原创 Posts Tagged 【Arrays】Insert Interval
Insert Interval Total Accepted: 30456 Total Submissions: 143835My SubmissionsQuestion Solution Given a set of non-overlapping intervals, insert a new interval into the intervals
2015-04-23 22:55:20
310
原创 Posts Tagged 【dp】Interleaving String
Interleaving String Total Accepted: 29109 Total Submissions: 141918My SubmissionsQuestion Solution Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.
2015-04-22 19:24:34
346
原创 Posts Tagged 【dp】Longest Valid Parentheses
Longest Valid Parentheses Total Accepted: 32725 Total Submissions: 158571My SubmissionsQuestion Solution Given a string containing just the characters '(' and ')', find the len
2015-04-21 00:23:51
363
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人