一道数据结构的线性表题
一道数据结构的线性表题
试分别用顺序表和单链表作为存储结构,实现将线性表(a0,a1,...,an-1)就地逆置的操作 ,所谓“就地”支付住空间应为O(1)(c语言)
试分别用顺序表和单链表作为存储结构,实现将线性表(a0,a1,...,an-1)就地逆置的操作 ,所谓“就地”支付住空间应为O(1)(c语言)
其他人气:252 ℃时间:2020-05-14 15:22:27
优质解答
void convert(Node *head) { //单链表逆置 Node *p=head; Node *newNode=null; Node *temp; while(p){ temp=p->next; p->next=newNode; newNode=p; p=temp; } } template //输出函数 void Singlelist::Output(ostrea...
我来回答
类似推荐
猜你喜欢
- 1你怎么又去上海了?英语翻译
- 2MgO + 2HNO3(稀)= Mg(NO3)2 + H2O的离子方程式
- 3聊聊(2010)热门话题500字
- 4二次根式√2a+1分之a^2+1中,字母a的取值范围
- 5英语翻译
- 6C35(3是上标,5是下标),请问这是什么数学问题,是排列组合吗?
- 7Why is my love ,through ups and downs 是什么意思?
- 8一个八面体两个相对的顶点分别为A,B,一个点从A出发,沿八面体的棱移动到B位置,
- 9lily and lucy like swimming 改为一般疑问句和否定句
- 10合并成含定语从句的复合句this is a photograph of my friends.i went on holiday with these friends