随笔分类 -  数据结构

JAVA链表简单实现
摘要:import java.util.Scanner;class DATA2{ String key; //结点的关键字 String name; int age;} class CLType //定义链表结构{ DATA2 nodeData=new DATA2(); CLType nextNode; //追加结点 CLType CLAddEnd(CLType head,DATA2 nodeData) { CLType node,htemp; if((node=new CLTy... 阅读全文
posted @ 2013-05-24 12:15 elleniou 阅读(5346) 评论(0) 推荐(0)
JAVA顺序表的简单实现
摘要:import java.util.Scanner; class DATA{ //模拟一个班级的学生记录 String key; String name; int age; } class SLType{ static final int MAXLEN = 100; DATA[] ListData = new DATA[MAXLEN+1]; int ListLen; //顺序表已存结点的数量 void SLInit(SLType sl){ sl.ListLen = 0; } int SLLength(SLType sl){ return (sl.ListLen... 阅读全文
posted @ 2013-05-24 11:30 elleniou 阅读(4146) 评论(0) 推荐(0)
线程----BlockingQueue
摘要:1 import java.util.concurrent.ArrayBlockingQueue; 2 3 import java.util.concurrent.BlockingQueue; 4 5 import java.util.concurrent.ExecutorService; 6 7 import java.util.concurrent.Executors; 8 9 10 11 /** 12 13 本例介绍一个特殊的队列:BlockingQueue,如果BlockQueue是空的,从BlockingQueue取东西的操作将会被阻断进入... 阅读全文
posted @ 2012-05-14 23:57 elleniou 阅读(236) 评论(0) 推荐(0)
C++ 二叉树的实现
摘要:1 #include<iostream.h> 2 struct tree 3 { 4 int data; 5 tree *left,*right; 6 }; 7 class Btree 8 { 9 static int n; 10 static int m; 11 public: 12 tree *root; 13 Btree() 14 { 15 root=NULL; 16 } 17 void create_Btree(int); 18 void Preorder(tree *)... 阅读全文
posted @ 2012-05-03 09:24 elleniou 阅读(33394) 评论(5) 推荐(4)