随笔分类 -  数据结构---链表

摘要:题目链接:https://leetcode-cn.com/problems/delete-node-in-a-linked-list/ 请编写一个函数,使其可以删除某个链表中给定的(非末尾)节点,你将只被给定要求被删除的节点。 现有一个链表 -- head = [4,5,1,9],它可以表示为: 示 阅读全文
posted @ 2019-08-12 17:05 wydxry 阅读(467) 评论(0) 推荐(0)
摘要:题目链接:https://www.dotcpp.com/oj/problem1676.html 题目描述 链表是数据结构中一种最基本的数据结构,它是用链式存储结构实现的线性表。它较顺序表而言在插入和删除时不必移动其后的元素。现在给你一些整数,然后会频繁地插入和删除其中的某些元素,会在其中某些时候让你 阅读全文
posted @ 2019-04-24 19:22 wydxry 阅读(774) 评论(0) 推荐(0)
摘要:复习一下链表,参考书目为:算法笔记 运行结果如下图: 阅读全文
posted @ 2019-04-23 22:38 wydxry 阅读(2818) 评论(0) 推荐(0)
摘要:1 #include <iostream> 2 #include <cstring> 3 #include <string> 4 using namespace std; 5 int n; 6 struct LinkList 7 { 8 int value;//数据域 9 struct LinkLi 阅读全文
posted @ 2018-01-23 17:13 wydxry 阅读(375) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 struct student 6 { 7 int num; 8 int score; 9 struct student *next; 10 }*head; 11 int main() 12 { 13 int n,m,l,nu,... 阅读全文
posted @ 2017-12-05 22:10 wydxry 阅读(414) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 const int N = 1000; 10 11 struct weapon{ 12 int price; 13 int atk; 14 ... 阅读全文
posted @ 2017-08-15 19:19 wydxry 阅读(326) 评论(0) 推荐(0)
摘要:1 #include <cstdio> 2 #include <iostream> 3 #include <cstring> 4 #include <string> 5 #include <cmath> 6 #include <algorithm> 7 using namespace std; 8 阅读全文
posted @ 2017-08-15 19:08 wydxry 阅读(325) 评论(0) 推荐(0)

Live2D