08年9月入学,12年7月毕业,结束了我在软件学院愉快丰富的大学生活。此系列是对四年专业课程学习的回顾,索引参见:http://blog.csdn.net/xiaowei_cqu/article/details/7747205
顺序队列各种基本运算算法的实现
顺序队列是较为普遍的一种队列实现方式,采用环状数组来存放队列元素,并用两个变量分别指向队列的前端(front)和尾端(rear),往队列中加进或取出元素时分别改变这两个变量的计数(count)。
队列中用环状数组存储数据(合理利用空间、减少操作),通过基本的append()将元素加入队列,serve()将元素移出队列,先进入的先移出,retieve得到最先加入队列的元素。此外在继承的Extended_queue()中我增加了empty()和serve_and_retrieve()的功能。
队列中用环状数组存储数据(合理利用空间、减少操作),通过基本的append()将元素加入队列,serve()将元素移出队列,先进入的先移出,retieve得到最先加入队列的元素。此外在继承的Extended_queue()中我增加了empty()和serve_and_retrieve()的功能。
【实验说明】
我选择的题目:课本中Programming Projects 3.3 P1
问题描述:Write a function that will read one line of input from the terminal. The input is supposed to consist of two parts separated by a colon ':'. As its results, your function should produce a single character as follows:
N No colon on the line.
L The left part(before the colon) is longer than the right.
R The right part(after the colon) is longer than the left.
D The left and right parts have the same length but are different.
S The left and right are exactly the same.
问题描述:Write a function that will read one line of input from the terminal. The input is supposed to consist of two parts separated by a colon ':'. As its results, your function should produce a single character as follows:
N No colon on the line.
L The left part(before the colon) is longer than the right.
R The right part(after the colon) is longer than the left.
D The left and right parts have the same length but are different.
S The left and right are exactly the same.
Examples:
Use either a queue or an extended queue to keep track of the left part of the line while reading the right part.
1.分析队列要实现的基本功能以及继承的类要拓展的功能从而确定基本
1.分析队列要实现的基本功能以及继承的类要拓展的功能从而确定基本

这篇博客回顾了作者在软件学院学习期间对数据结构中顺序队列的基本运算算法的实现,包括实验说明、相关代码、过程记录和结果分析。提供了实验代码的下载链接,并要求转载时注明作者和出处。
最低0.47元/天 解锁文章
1961

被折叠的 条评论
为什么被折叠?



