链表中结点的分配和回收是由系统提供的标准函数malloc和free动态实现的,称之为动态链表。
如果程序支持指针,则可按照我们的一般形式实现链表, 需要时分配,不需要时回收即可.
动态链表的空间是可以动态扩展的。
typedef struct node{
EleType data;
struct node * pNext;
}Node;
有些高级语言中没有“指...
分类:
其他好文 时间:
2014-05-10 10:38:07
阅读次数:
297
基本概念
MongoDB是一个高性能,开源,无模式的文档型数据库,是当前NoSql数据库中比较热门的一种。它在许多场景下可用于替代传统的关系型数据库或键/值存储方式(
文件存储格式为BSON(一种JSON的扩展))。Mongo使用C++开发。Mongo的官方网站地址是:http://www.mong...
分类:
数据库 时间:
2014-05-07 19:53:39
阅读次数:
572
Given a binary tree, find the maximum path
sum.The path may start and end at any node in the tree.For example:Given the
below binary tree, 1 ...
分类:
其他好文 时间:
2014-05-07 09:36:09
阅读次数:
300
mongodb的读写分离使用Replica Sets来实现对于replica set
中的secondary 节点默认是不可读的。在写多读少的应用中,使用Replica
Sets来实现读写分离。通过在连接时指定或者在主库指定slaveOk,由Secondary来分担读的压力,Primary只承担写操...
分类:
数据库 时间:
2014-05-07 09:31:37
阅读次数:
531
题目来源:HDU 1542 Atlantis
题意:给你一些矩形(左下角和右上角)求面积
思路:参考here这个超赞的 一看就懂了
#include
#include
#include
#include
using namespace std;
const int maxn = 210;
struct node
{
double l, r, h;
int s, val;
nod...
分类:
其他好文 时间:
2014-05-07 08:59:09
阅读次数:
395
public class LinkedList {
Node head = null;
Node tail = null;
int length = 0;
public void add(Object object) {
Node node = new Node(object, null);
if (head == null) {
head = tail = nod...
分类:
其他好文 时间:
2014-05-07 08:24:17
阅读次数:
306
题意:所有n个人围成一个圈,
#include
#include
struct Node
{
int data;
Node *next;
Node *prior;
};
Node* CreateList(Node* &head, int n);
Node* searchk(Node *ptr, Node* &head, int k);
Node* rsearchm(Node...
分类:
其他好文 时间:
2014-05-07 06:26:28
阅读次数:
327
Cocos2d-x采用层级(树形)结构管理场景、层、精灵、菜单、文本、地图和粒子系统等节点(Node)对象。一个场景包含了多个层,一个层又包含多个精灵、菜单、文本、地图和粒子系统等对象。层级结构中的节点可以是场景、层、精灵、菜单、文本、地图和粒子系统等任何对象。节点的层级结构这些节点有一个共同的父类...
分类:
其他好文 时间:
2014-05-06 14:20:59
阅读次数:
272
#include#define NULL 0struct Node{ char po[10];
struct Node *next;};int main(void){ struct Node a,*head,*p; a.po[10]="abc";
struct Node...
分类:
其他好文 时间:
2014-05-06 14:14:13
阅读次数:
288
地理位置索引支持是MongoDB的一大亮点,这也是全球最流行的LBS服务foursquare
选择MongoDB的原因之一。我们知道,通常的数据库索引结构是B+
Tree,如何将地理位置转化为可建立B+Tree的形式,下文将为你描述。首先假设我们将需要索引的整个地图分成16×16的方格,如下图(左下...
分类:
数据库 时间:
2014-05-06 13:51:06
阅读次数:
341