• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
My Blog
博客园    首页    新随笔    联系   管理    订阅  订阅
07 2024 档案
数组利用哨兵位查找元素

摘要:数组利用哨兵位查找元素 存储时把数组的下标0处空出,留着放哨兵位; 从后向前遍历数组,直到找到目标元素,或者找到哨兵结束; 根据被找到元素的所在位置判断元素是否在数组中存在 在 0 处:不存在 不在 0 处:存在 实现: int searchBySent(int * arr, int target) 阅读全文
posted @ 2024-07-28 19:07 codels 阅读(77) 评论(0) 推荐(0)
【数据结构】二叉树

摘要:二叉树 结构描述: #include <iostream> #include <queue> using namespace std; typedef int DataType; class Node { private: DataType data; Node * left; Node * rig 阅读全文
posted @ 2024-07-25 13:50 codels 阅读(35) 评论(0) 推荐(0)
【练手】简易通讯录:单链表实现

摘要:实现一个简单的通讯录,有最基本的增删改查功能。 阅读全文
posted @ 2024-07-19 12:37 codels 阅读(86) 评论(0) 推荐(0)
【数据结构】双链表

摘要:双链表 结构描述: #include <iostream> #include <cstdlib> using namespace std; typedef int DataType; //链表节点 typedef struct Node { DataType A; struct Node * Pre 阅读全文
posted @ 2024-07-18 20:48 codels 阅读(58) 评论(0) 推荐(0)
【数据结构】栈:数组实现

摘要:栈:数组实现 结构描述: #define MAX 100 typedef int DataType; class SeqStack { public: DataType * A; int Top; void Init(); void Push(DataType X); void Pop(); Dat 阅读全文
posted @ 2024-07-18 14:43 codels 阅读(42) 评论(0) 推荐(0)
【数据结构】双栈:数组实现

摘要:双栈:数组实现 结构描述: #include <iostream> #include <cstdlib> #define MAX 100 using namespace std; typedef int DataType; class DoubleStack { public: DataType * 阅读全文
posted @ 2024-07-18 14:42 codels 阅读(80) 评论(0) 推荐(0)
【数据结构】栈:链表实现

摘要:栈:链表实现 结构描述 #include <iostream> #include <cstdlib> typedef int DataType; using namespace std; typedef struct Node { DataType A; struct Node * Next; }N 阅读全文
posted @ 2024-07-18 14:42 codels 阅读(44) 评论(0) 推荐(0)
【数据结构】单链表

摘要:单链表 先来看看它的结构, 这是一个被用户自定义出来的一个数据类型, 名字叫 struct Node, 再使用 typedef 命名为 Node. DataType A 称为链表节点的数据域 struct Node * Next 称为链表节点的指针域, 存放的是相对于当前节点的下一个节点的地址. t 阅读全文
posted @ 2024-07-18 14:41 codels 阅读(76) 评论(0) 推荐(0)
【数据结构】顺序表

摘要:顺序表 结构描述 #include <iostream> #include <cstdlib> #define MAX 100 using namespace std; typedef int DataType; class SeqList { private: DataType * A; int 阅读全文
posted @ 2024-07-18 14:41 codels 阅读(53) 评论(0) 推荐(0)
【数据结构】循环队列:链表实现

摘要:循环队列:链表实现 结构描述 typedef int DataType; typedef struct QueueNode { DataType A; struct QueueNode * Next; }Node; class QueueCycLinked { public: //队头、队尾指针 N 阅读全文
posted @ 2024-07-18 14:38 codels 阅读(162) 评论(0) 推荐(0)
【数据结构】队列:链表实现

摘要:队列:链表实现 结构描述: typedef int DataType; typedef struct QueueNode { DataType A; struct QueueNode * Next; }Node; class QueueLinked { public: //队头、队尾指针 Node 阅读全文
posted @ 2024-07-18 14:35 codels 阅读(117) 评论(0) 推荐(0)

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3