- 博客(13)
- 收藏
- 关注
原创 个人版双向链表的操作
#include #include #include #include using namespace std; typedef struct node { int data; struct node *pre,*next; }LNode,*ListNode; void InIt(ListNode list) { assert(list!
2014-04-28 17:33:33 667
转载 C语言字符串库函数的实现
http://www.cnblogs.com/luxiaoxun/archive/2012/09/04/2670202.html
2014-04-21 15:55:02 763
转载 操作系统基础知识
操作系统常见面试题总结 1、什么是进程(Process)和线程(Thread)?有何区别? 进程是具有一定独立功能的程序关于某个数据集合上的一次运行活动,进程是系统进行资源分配和调度的一个独立单位。线程是进程的一个实体,是CPU调度和分派的基本单位,它是比进程更小的能独立运行的基本单位。线程自己基本上不拥有系统资源,只拥有一点在运行中必不可少的资源(如程序计数器,一组寄存器和栈)
2014-04-20 16:57:35 695
原创 C++学习笔记---利用对象、引用、指针调用虚函数
虚函数总结: 虚函数只能是类成员函数,它在基类体内部说明,目的是提供一种接口界面; 虚函数不能是友元函数(即非成员函数),也不能是静态成员函数,因为虚函数调用要靠特定的对象来决定该激活哪个函数。虚函数可以在另一个类中被声明为友元函数; 一旦一个函数定义为虚函数,那么无论它传下多少层,都将保持为虚函数,而不必每
2014-04-19 21:51:32 2111
转载 C++之运算符重载
http://www.cnblogs.com/CaiNiaoZJ/archive/2011/08/12/2136598.html
2014-04-19 21:20:24 690
原创 希尔排序
package com.yunix.shellSort; import java.util.Random; public class Sort { /** * 希尔排序也是一种插入排序方法,实际上是一种分组插入方法 * 先取一个小于n的整数d1作为一个增量,把表的全部记录分成d1个组,所有 * 距离为d1的倍数的记录放在同一个组中,在各组内进行直接插入排序,然后 * ,取第
2014-04-19 15:09:07 605
原创 二叉树的最低公共祖先(剑指offer)
#include #include #include #include #include using namespace std; #define M 2002*2 typedef struct Tree { int data; struct Tree *lson,*rson; } Tnode,*ListTree; int cnt; ListTree a,b; int
2014-04-19 14:12:06 915
原创 递增数列中找和为s乘积最小的两个数
#include void getSumKPair(int *arr, int n, int k, int &a, int &b) { int nLow, nHigh; long long product; nLow = 0, nHigh = n-1; a = b = -1, product = 0x7fffffff; int flag=0; wh
2014-04-18 14:44:01 894
原创 不用加减乘除做加法
#include #include #include #include using namespace std; #define M 1001 int judge(int n,int m) { if(m==0) return n; return judge(n^m,(n&m)<<1); } int main() { int n,m; whi
2014-04-18 13:50:08 532
原创 判断B树是否是A的子树
#include #include #include #include using namespace std; #define M 1001 typedef struct Tree { int data; struct Tree *lson,*rson; } TNode,*ListTree; ListTree built(int n) { int val;
2014-04-18 13:36:12 828
原创 非递减合并两个有序单链表
#include #include #include using namespace std; typedef struct Node { int data; struct Node * next; } LNode,*LinkList; LinkList built(int n) { LinkList p,r,list; list=(LinkList)mal
2014-04-18 00:43:47 3792
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人