03 2015 档案
摘要:题目:Given a linked list, remove thenthnode from the end of list and return its head.For example: Given linked list: 1->2->3->4->5, and n = 2. After...
阅读全文
摘要:题目: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...
阅读全文
摘要:题目:Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the ...
阅读全文
摘要:问题描述:字符序列的子序列是指从给定字符序列中随意地(不一定连续)去掉若干个字符(可能一个也不去掉)后所形成的字符序列。令给定的字符序列X=“x0,x1,…,xm-1”,序列Y=“y0,y1,…,yk-1”是X的子序列,存在X的一个严格递增下标序列,使得对所有的j=0,1,…,k-1,有xij=yj...
阅读全文
摘要:题目: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 sing...
阅读全文
摘要:MFC的 程序框架:WinMain函数:程序首先到达全局变量theApp,再到达theAPP的构造函数,最后到达WinMain函数处。问:为何要定义一个全局对象theAPP,让其在WinMain函数之前执行?答:在win32应用程序中,应用程序的实例是由实例句柄hInstance来标识的,对于MFC...
阅读全文
摘要:C++本身并没有提供任何多线程机制,但是在windows下,我们可以调用SDK win32 api来编写多线程的程序,下面就此简单的讲一下:创建线程的函数HANDLE CreateThread( LPSECURITY_ATTRIBUTES lpThreadAttributes, // SD SI...
阅读全文