自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

周峰专栏

共同学习,共同进步

  • 博客(10)
  • 收藏
  • 关注

原创 remove函数的实现

templateError_code List::remove(int position, const List_entry &x){if(empty())return underflow;/*if(position>0||position<count)delete x;*/if(position=count)//判断范围return range_error;//范

2013-09-24 20:25:08 625

原创 c++ setw和setfill的使用

setw()是设置域宽的函数,默认是前面加空格右对齐。setfill()是设置填充填充字符。哈理工oj 1034题举例:#include using namespace std; #include int main() { cout<<setw(8)<<setfill('*')<<123<<endl; cout<<setw(8)<<456<<endl; return 0;

2013-09-14 11:31:11 7585 2

原创 Exercise 4.2 E2(a)和Exercise4.3E2

E2(a) int Stack::size()const {     Node *p=top_node;     int count=0;     while(p!=NULL)     {         p=p->next;         count++;     }     return count; }E2  void Stack::op

2013-09-12 12:41:38 583

原创 Exercise 4.2 E2

(a).    Node *p0=new Node('0');               //每个Node结点无名    Node *p1=p0->next=new Node('1');// p1->next默认为NULL(b).    Node *p0=new Node('0')                 //p0->next 默认为NULL

2013-09-05 11:48:06 648

原创 Exercise 4.1 E1

2013-09-05 11:29:40 575

原创 对3.4中do_command函数的实现

初学者,如有错误请指点。bool do_command(char c,Extened_queue&text_queue){    bool continue_input=true;    Queue_entry=x;    switch(c)    {    case'a':            if(text_queue.append(x)==overflow)

2013-09-05 10:56:31 753

原创 对Exercise E2.(b)的理解与答案 (数据结构与程序设计C++)

题目:Use the Stack mehod and a temporary Stack to retrieve entries from the Stack source and add             each entry to theStack dest and restore the Stack source.理解:用栈的方法,通过使用临时定义的一个栈,将sourc

2013-08-29 12:40:25 586

原创 铁道交换网问题

(a).当n=3时:有五种情况 1,2,3         2,1,3           2,3,1           3,1,2          3,2,1 (b).当n=4时:有十四种情况 1,2,3,4       2,1,3,4        2,3,1,4         2,3,4,1            3,1,2,4           3,2,1,4

2013-08-29 08:59:00 656

原创 栈的实现

const int maxstack=100;enum Error_code={success,overflow,underflow};class Stack{public:    Stack();    bool empty()const;                // 常函数,only read    Error_code pop();    Error_

2013-08-28 11:57:38 512

原创 《数据结构与程序设计》程序设计技术规则总结

在阅读了《数据结构与程序设计》第一章之后,本人对第一章中的程序设计技术规则作出如下总结。 一、编写的每个程序。函数,和方法要包含准确的前置条件和后置条件。         为每个函数包含准确的前置条件和后置条件不仅清晰的解释了函数的目的,也有助于我们避免函数间的接口错误。二、最审慎地选择类,变量和函数的名称,并予以详尽的解释。         即使数据和算法事先已经存在,只有当他们

2013-08-22 09:32:21 693

空空如也

空空如也

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

TA关注的人

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