ICode9

精准搜索请尝试: 精确搜索
  • 写if不要习惯性省略else2022-04-27 11:33:46

        问题:每次执行 ListInsert 功能,线性表长度都加了3而不是1 最后发现因为 if 后没有 else,每执行一次功能函数都被调用了3次。。。   另外即使不出问题,也会浪费时间。

  • 实现双链表的各基本算法2021-09-26 22:03:32

    #include <stdio.h> #include <stdlib.h> #include <malloc.h> typedef char ElemType; typedef struct DNode { ElemType data; struct DNode *prior; struct DNode *next; }DLinkNode; int CreateList(DLinkNode *L, ElemType a[], int n ) { DLi

  • 顺序表的操作——删除2021-07-13 21:32:49

    #include <bits/stdc++.h>#include <stdio.h>#include <stdlib.h>#include <cstdlib>#define MaxSize 10using namespace std;//顺序表的删除typedef struct { int data[MaxSize]; int length;} SqList;void InitList(SqList &L) { for (int i

  • 3.顺序表的插入2021-06-14 19:03:35

    #include <stdio.h>#define MaxSize 10typedef int ElemType;typedef struct{ int data[10]; int length;}SqList; void InitList(SqList &L){ for(int i=0;i<MaxSize;i++){ L.data[i]=0; L.length=0; } } //插入 void ListInsert(SqList &L,int i,int e

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有