
算法
杨小卫
技术男
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
多叉树的递归遍历和堆栈遍历【多叉树的前序遍历及后续遍历】
//多叉树递归遍历//假设树节点定义为:struct Node{ Node *pPNode; list<Node *> childs;};//前序遍历(正序遍历):void EnumNode(Node *pNode){ do_something(pNode); list<Node *>::iterator iter; //正向遍...原创 2010-10-14 15:07:00 · 7863 阅读 · 0 评论 -
SHA1 加密算法
<br />#include "stdafx.h"#include <string.h>#include <stdlib.h>#include <stdio.h>typedef unsigned __int64 UINT64;#define NULL 0// The standard SHA1 needs the input string to fit into a block// This function align the input string to meet转载 2011-05-28 16:39:00 · 4871 阅读 · 0 评论 -
模拟Windows句柄的实现于管理
#ifndef _HANDLE_MGR_H_#define _HANDLE_MGR_H_#undef MALLOC#undef FREE#define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))#define FREE(x) HeapFree(GetProcessHeap(), 0, (x))#define T原创 2012-03-28 13:32:48 · 1336 阅读 · 1 评论 -
使用Hash表实现快速索引缓冲
enum { kHashBits = 8, kHashCount = 1 << kHashBits, //Hash表大小(1<<8=256),值越大缓存检索越快};struct data_t{ unsigned int id; //必须是唯一值,ID不能为0 char * data_ptr;};static data_t...原创 2019-04-06 15:12:16 · 354 阅读 · 0 评论