题目内容

栈和队列的共同点是( )。

A. 都是先进后出
B. 都是先进先出
C. 只允许在端点处插入和删除
D. 没有共同点

查看答案
更多问题

栈的入栈序列是a,b,c,d,e,则栈的不可能的输出序列是( )。

A. edcba
B. dceba
C. dceab
D. abcde

程序填空:设计一个类模板,其中包括数据成员一维动态数组以及在其中进行查找数据元素的成员函数int search(T)。#include using namespace std;______1______class A{private:int size;T* element;public:A(intsz);~A();int Search(T);void SetElement(int index,const T& value);};templateA::A(intsz){ size=sz>1? sz:1; element=new T[size]; }templateA::~A(){ delete [] element; }template______2________){int i;for(i=0;ivoid A::SetElement(int index,const T& value){ element[index]=value; }int main(){____3______; //用int实例化,建立模板类对象intAry,初始长度为5_____4______;//用double实例化,建立模板类对象douAry,初始长度为10for(inti=0;i<5;i++)intAry.SetElement(i,i+3);for(inti=0;i<10;i++)douAry.SetElement(i,(i+i)*0.35);inti=intAry.Search(7);if(i>=0)cout<=0)cout<

Fill in the blank with the word given below. Change the form where necessary. Each word can be used only once.1.Fortunately, the accident didn't _____ many people, for there was little traffic at that hour.

Fill in the blank with the word given below. Change the form where necessary. Each word can be used only once.2.She______ her ambition of becoming a fashion designer after years of hard work.

答案查题题库