bitmap是一种简单的数据结构,但在存储空间压缩方面却使用广泛。
bitmap就是用一个bit位来标记某个元素是否存在:1表示存在,0表示不存在;而2-bitmap就是用两个bit为来标记某个元素出现的次数:00出现0次,01出现1次,10出现2次及其以上,11无意义。
2-bitmap在内存中的表示如下:
[0] [1] [2] ……
|00 00 00 00|00 00 00 00|00 00 ...
分类:
其他好文 时间:
2014-06-29 07:29:20
阅读次数:
300
上学期数据结构课上写的一个二叉树类,贴出来,写得不是太好,欢迎高手指点。
struct BiNode//定义节点类型
{
char data;
BiNode *lchild;
BiNode *rchild;
};
class BiTree
{
private:
BiNode *root;
public:
BiTree()
{
root=NULL;
}
~BiT...
分类:
其他好文 时间:
2014-06-20 11:19:10
阅读次数:
193
Xcode 5中苹果对多个体系框架及相干类库进行了改进。之前建树的项目在Xcode
5中从头编译会产生一些新题目。JosnKit是常用的轻量级Josn解析类,在Xcode 5中:
BOOLworkAroundMacOSXABIBreakingBug = (JK_EXPECT_F(((NSUInteg...
分类:
其他好文 时间:
2014-06-07 08:54:47
阅读次数:
474
总是报错:root@gitlab:/opt# newlispnewLISP v.10.6.0
64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h> (load
"/opt/mysql.lsp")ERR: string expected i...
分类:
数据库 时间:
2014-06-06 20:55:10
阅读次数:
298
/* * linux/boot/head.S * * Copyright (C) 1991,
1992 Linus Torvalds *//* * head.S contains the 32-bit startup code.
*/.text.globl _idt,_gdt,.globl ...
分类:
其他好文 时间:
2014-06-06 15:11:14
阅读次数:
417
base64_encode将字符串以 BASE64 编码。语法: string
base64_encode(string data);返回值: 字符串函数种类: 编码处理解释:设计此种编码是为了使二进制数据可以通过非纯 8-bit
的传输层传输,例如电子邮件的主体。本函数将字符串以 MIME BAS...
分类:
Web程序 时间:
2014-06-05 18:12:20
阅读次数:
252
用bit mask来做枚举还挺方便的这个大概是给你一个vector
array,求出这个array里任意几个元素加和所不能得到最小的整数。元素个数最大20个,每个元素不超过100000比如[1,2,4],那么就应该返回8.
(因为3=1+1, 5=1+4等等)所以枚举这个array的所有子集求和,之...
分类:
其他好文 时间:
2014-06-05 17:25:52
阅读次数:
246
网易镜像站点 http://mirrors.163.com/搜狐镜像站点
http://mirrors.sohu.com/阿里云镜像站点 http://mirrors.aliyun.com/北京理工大学镜像站点 IPV4
http://mirror.bit.edu.cn/web/IPV6 http....
分类:
系统相关 时间:
2014-06-02 19:54:49
阅读次数:
410
问题描述
写一个函数,求两个整数之和,要求在函数体内不得使用+、-、*、/四则运算符号。
算法描述
从二进制运算入手,
1.a^b求出各bit的和,
2.a&b求出需要进位的bits,
3
4.重复1、2、3直至a&b==0(即进位为0),得到结果。
代码
int add(int num1,int num2)
{
if(num2==0)
retu...
分类:
其他好文 时间:
2014-06-02 12:38:46
阅读次数:
225
查看自己电脑已安装的Jdk的位数的方法:
public class ShowJdkBit {
public static void main(String[] args) {
String arch = System.getProperty("sun.arch.data.model");
System.out.println(arch + "-bit");
}...
分类:
其他好文 时间:
2014-06-02 12:30:19
阅读次数:
155