![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
今天要来电代码吗
What does not kill me, makes me stronger.
展开
-
反转链表
反转一个单链表 示例: 输入: 1->2->3->4->5->NULL 输出: 5->4->3->2->1->NULL 方法一:递归 class Solution { public: ListNode* reverseList(ListNode* head) { if(head == nullptr || head->next == nullptr){ return head;原创 2021-03-02 21:39:54 · 60 阅读 · 0 评论 -
单链表的建立
单链表的建立 #include <iostream> using namespace std; template<class DateType> struct Node { DateType date; Node<DateType> *next; }; template<class DateType> class LinkList { public: LinkList(); LinkList(DateType a[],in原创 2020-10-18 18:09:49 · 138 阅读 · 0 评论 -
线性表的建立
线性表的建立 #include <iostream> using namespace std; const int MaxSize=100; template<class DateType> class SepList { public: SepList(){length=0;}; SepList(DateType a[],int n); ~SepList(){}; int Length(){return length;} DateType原创 2020-10-18 18:06:36 · 637 阅读 · 0 评论