自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(130)
  • 资源 (1)
  • 收藏
  • 关注

转载 JAVA线程同步中wait()和notify()简洁例子

JAVA线程同步中wait()和notify()简洁例子  搞懂这两个的用法之前,请你务必搞懂线程同步的道理,否则,下面这一大篇你应该是看不懂的。wait()和notify()一系列的方法,是属于对象的,不是属于线程的。它们用在线程同步时,synchronized语句块中。我们都知道,在synchronized语句块中,同一个对象,一个线程在执行完这一块代码之前,另一个线程,如果传进来

2015-07-27 13:08:01 607

转载 Android触摸机制

在Android中,事件主要包括点按、长按、拖拽、滑动等,点按又包括单击和双击,另外还包括单指操作和多指操作。所有这些都构成了Android中得事件响应。总的来说,所有的事件都由如下三个部分作为基础:按下(ACTION_DOWN)移动(ACTION_MOVE)抬起(ACTION_UP)所有的操作事件首先必须执行的是按下操作(ACTION_DOWN),之后所有的操作都是以

2015-07-26 00:20:22 553

原创 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 724

原创 Android_照相机Camera_调用系统照相机返回data为空

Android_照相机Camera_调用系统照相机返回data为空 有的手机,在拍照调用Intent过程中,activity的跳转,会把原来activity的一些参数,尤其是涉及到拍照的路径等的参数给pass掉,这样获取的也许就是为null了,所以要把中间的一些变量都要保存下来,可以使用static,同时注意横竖屏。因为有些手机不管你自己保不保存,它都会按照手机自身的设置来保存

2015-06-14 22:27:53 609

原创 select的理解

所谓文件描述符,就是你用来表示输入输出对象的整数,例如打开的文件以及网络通信用的套接字等。文件描述符的数量也是有限的,在Linux默认下,一个进程所能打开的文件描述符最大是1024个。用单线程来处理多个连接的时候,像等待套接字收到数据的过程,这种阻塞是致命的,为了避免阻塞,我们必须在读取数据前先检查文件描述符中的输入是否已经达到并可用。在unix中,对于多个文件描述符,可以使用一个叫做se

2015-05-26 17:33:11 535

原创 C++/PHP面经回馈学弟学妹(新浪阿里百度同花顺华为)

98转:http://www.cc98.org/dispbbs.asp?boardID=235&ID=4427297&page=[经验]C++/PHP面经回馈学弟学妹(新浪阿里百度同花顺华为)我属于最普通的那类学生,简历里基本没有任何能拿得出手的东西,奖学金没有,PAT没有,数学建模、ACM和我更没关系,在孙学长和朱学长的指点下,也算找到了令自己满意的工作,也希望能帮助和我一样需要帮助

2015-05-14 09:13:48 1299

转载 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 411

原创 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 390

原创 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 796

原创 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 317

原创 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 373

原创 回溯法

回溯法

2015-05-03 02:10:21 351

原创 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 395

原创 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 344

原创 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 470

原创 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 389

原创 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 445

原创 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 440

原创 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 449

原创 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 440

原创 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 362

原创 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 523

原创 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 311

转载 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 318

原创 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 344

原创 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 322

原创 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 441

原创 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 417

原创 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 338

原创 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 484

原创 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 380

原创 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 355

原创 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 328

原创 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 387

原创 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 473

原创 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 674

原创 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 415

原创 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 289

原创 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 327

原创 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 351

Android编程权威指南英文版

Android编程权威指南Android Programming the big nerd ranch guide

2014-09-23

空空如也

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

TA关注的人

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