- 博客(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;ientry[i]=entry[
2013-09-24 22:31:16 387
原创 《数据结构》示范程序\优先队列的堆实现
这是我在有关算法寄存器的网站上看到的,COPY过来,以供参考。/*优先队列的堆实现,本程序提供了优先队列的基本操作*/#include#include#define MAXNUM 100typedef int DataType;typedef struct{ DataType element[MAXNUM]; int
2013-09-08 18:20:06 462
原创 队列(Queue),堆栈(Stack)
原文链接:Part 2: The Queue, Stack, and Hashtable本文是"考察数据结构"系列文章的第二部分,考察了三种研究得最多的数据结构:队列(Queue),堆栈(Stack)和哈希表(Hashtable)。正如我们所知,Quenu和Stack其实一种特殊的ArrayList,提供大量不同类型的数据对象的存储,只不过访问这些元素的顺序受到了限制。Hashtable则
2013-09-08 18:15:53 789
原创 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 464
原创 Chapter3 Exercises3.3 E7
重新编写课本中队列处理的方法,使用一个标志而不是保持队列中元素个数的计数来指示满队列。#includeusing namespace std;const int maxqueue = 10; class Queue{ public: Queue( ); bool empty( ) const; Error_code serve(
2013-08-28 19:31:23 474
原创 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 511
原创 Chapter 2 Exercise 2.1 E4
E4a. 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;3124c.(C n/2n) /(n+1)
2013-08-28 19:07:26 587
原创 The Summary of Chapter 1
To be an outstangding programmer----Thesummary of Chapter 1I 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 610 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人