- 博客(5)
- 资源 (1)
- 收藏
- 关注
转载 多线程死锁代码实例
package com.oyqh; public class RunnableTest implements Runnable { private int flag = 1; private Object obj1 = new Object(), obj2 = new Object(); public void run() {
2013-01-28 20:51:57 628
原创 单链表的实现
#include #include typedef struct list{ int data; struct list *next;}List;/*function:初始化为带表头的单链表input:voidoutput:List型指针*/List *initList(void){ List *L = (Li
2013-01-21 21:44:35 578
原创 栈的数组实现
#include #include typedef struct{ int *array; int size; int top;}stack;/*function:initial the stack with the sizeinput:stack *s, int sizeoutput:void*/void ini
2013-01-21 21:42:36 459
原创 1到n的全排列实现
对于1到n的全排列问题,常见的是用递归的方法输出所有的排列,本文是一种非递归的实现方法。具体原理如下:已知共有n!个排列方式,可以对这些排列方式编号:0到(n!-1),每个编号唯一地对应一个排列方式。循环地根据每个编号来还原出它所对应的排列方式即可。如何编号呢?以n=4为例:1234--0 1243--1 1324--2 1342--3 1423--4
2013-01-19 15:31:48 2707
原创 初解骑士问题
#include #include "stdafx.h"#include #define ROW 8#define COL 8typedef struct { int x; int y;}Pos;Pos IndexPos[8] = {{-2,-1},{-2,1},{-1,2},{-1,-2},{1,2},{1,-2},{2,1},{2,-1}};Pos C
2013-01-19 13:42:09 601
BarcodeScanner_4.7.3.apk
2015-04-15
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人