自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 remove函数1

remove函数: Error_code List::remove(int position, List_entry &x) { if(count==0) return underflow; if(position=count) return range_error; x=entury[position]; for(int i=position;i entry[i]=entry[

2013-09-24 22:31:16 475

原创 《数据结构》示范程序\优先队列的堆实现

这是我在有关算法寄存器的网站上看到的,COPY过来,以供参考。 /*优先队列的堆实现,本程序提供了优先队列的基本操作*/ #include #include #define  MAXNUM   100 typedef     int  DataType; typedef     struct {    DataType  element[MAXNUM];       int 

2013-09-08 18:20:06 537

原创 队列(Queue),堆栈(Stack)

原文链接:Part 2: The Queue, Stack, and Hashtable 本文是"考察数据结构"系列文章的第二部分,考察了三种研究得最多的数据结构:队列(Queue),堆栈(Stack)和哈希表(Hashtable)。正如我们所知,Quenu和Stack其实一种特殊的ArrayList,提供大量不同类型的数据对象的存储,只不过访问这些元素的顺序受到了限制。Hashtable则

2013-09-08 18:15:53 886

原创 Chapter 4 Exercise4.1 E1 E2 解答

Draw a diagram to illustrate the configuration of linked nodes that is created by the following statements//根据下列语句画一个图来说明链接节点的配置 Node *p0 = new Node('0'); Node *p1 = p0->next = new Node('1'); Node

2013-09-08 18:07:02 555

原创 Chapter3 Exercises3.3 E7

重新编写课本中队列处理的方法,使用一个标志而不是保持队列中元素个数的计数来指示满队列。 #include using namespace std; const int maxqueue = 10;             class Queue{  public:   Queue( );   bool empty( ) const;   Error_code serve(

2013-08-28 19:31:23 560

原创 Chapter 2 Exercises2.2 E2(b)

用栈实现题目中的要求: 使用栈的方法和一个临时栈,从栈源检索条目、添加入栈和恢复栈源。 Error_code copy_stack(Stack &dest,Stack &source)  { Error_code detected=success; Stack temp; Stack_entry item; while(detected==success&&!source.empty

2013-08-28 19:23:05 597

原创 Chapter 2 Exercise 2.1 E4

E4 a. 5种 n=3时, 123; 132; 321;213;312  b.14种 n=4时,4123;1423;1243;1234;4132;1432;1324; 4321;3214;4213;2143;2134;4312;3124 c.(C n/2n) /(n+1)

2013-08-28 19:07:26 684

原创 The Summary of Chapter 1

To be an outstangding programmer ----Thesummary of Chapter 1 I havealready read the Chapter 1 of >,It mainly talks about Programming Principles,I think some sentencesfrom this chapter are very usefu

2013-08-20 21:06:27 753 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除