- 博客(6)
- 收藏
- 关注
原创 【LeetCode OJ 019】Remove Nth Node From End of List
题目:Given a linked list, remove the nth node from the end of list and return its head.For example: Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end,
2015-03-31 14:53:58 617
原创 【LeetCode OJ 001】Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, whe
2015-03-30 19:22:33 589
原创 【LeetCode OJ 169】Majority Element
题目:Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority ele
2015-03-28 14:24:01 547
原创 最长公共子序列问题
问题描述:字符序列的子序列是指从给定字符序列中随意地(不一定连续)去掉若干个字符(可能一个也不去掉)后所形成的字符序列。令给定的字符序列X=“x0,x1,…,xm-1”,序列Y=“y0,y1,…,yk-1”是X的子序列,存在X的一个严格递增下标序列,使得对所有的j=0,1,…,k-1,有xij=yj。例如,X=“ABCBDAB”,Y=“BCDB”是X的一个子序列。解决方法:1、穷举
2015-03-24 15:58:04 509
原创 【LeetCode OJ 002】Add Two Numbers
题目:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a l
2015-03-23 20:16:27 446
转载 C++多线程编程简单实例
C++本身并没有提供任何多线程机制,但是在windows下,我们可以调用SDK win32 api来编写多线程的程序,下面就此简单的讲一下: 创建线程的函数HANDLE CreateThread( LPSECURITY_ATTRIBUTES lpThreadAttributes, // SD SIZE_T dwStackSize,
2015-03-16 21:28:52 547
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人