![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
Zhang_2002_GZ
这个作者很懒,什么都没留下…
展开
-
数据结构PTA
title: 曲师大计院20级的PTAcategories: - 数据结构tags: - PTAtoc: true第一章 绪论判断题1-1数据元素是数据的最小单位。F(数据项)1-2数据的逻辑结构是指数据的各数据项之间的逻辑关系。F(数据元素之间)1-3数据结构概念包括数据之间的逻辑结构、数据在计算机中的存储方式和数据的运算三个方面。T1-4数据结构的抽象操作的定义与具体实现有关。F1-5算法和程序没有区别,在数据结构中二者是通用的。F1.原创 2022-02-24 16:54:05 · 3859 阅读 · 0 评论 -
数据结构基础知识
title: 数据结构笔记categories: - 数据结构tags: - 笔记toc: true第二、三、四章 线性表字符串:线性表特例多维数组:线性表推广(严格不是)线性表(表):具有相同类型的数据元素的有限序列-> 将元素类型限制为字符:字符串(串):零个或多个字符组成的有限序列串长:串中所包含的字符个数空串:长度为 0 的串子串:串中任意个连续的字符组成的子序列(包含空串) 主串:包含子串的串 子串的位置:子串的第一个字符在主串中的序号.原创 2022-02-24 16:51:41 · 1985 阅读 · 0 评论 -
KMP算法
i 0 1 2 3 4 5 6 char[i] a b a b a b c next -1 0 0 1 2 3 4 nextval -1 0 -1 0 -1 0 4 一、过程:求next值:1.两个固定值:char[0]_next=-1; char[1]_next=0(一个,没有匹配的,长度为0)2.开始求:char[2]原创 2021-10-29 19:50:33 · 392 阅读 · 0 评论 -
2729:Blah数集
#include<iostream>using namespace std;int main(){ int a,n; while(cin>>a>>n) { int aa[n],bb[n],Ba[n]={a}; int i1=0,j1=0,i2=0,j2=0,N=1,x; while(N<n) { aa[i1++]=2*a+1; .原创 2021-10-29 19:00:09 · 150 阅读 · 0 评论 -
6263:布尔表达式
#include<iostream>using namespace std;#include<string>#include<map>char relate[7][7] ={ // ! & | ( ) # {'=', '>', '>', '<', '>', '>'}, // ! {'<', '>', '>', '<', '>', '>.原创 2021-10-16 00:36:04 · 509 阅读 · 0 评论 -
单链表练习:方法实现
#include<iostream>using namespace std;struct Node{ Node *next; int data;};//有空改善+继续补充:可以将遍历index的循环写进一个方法里吗?//链表尾插初始化,是否考虑一下空数列的情况?class List{public: List(); //初始化:头结点 ~List(); //析构:销毁单链表 List(int a[],int n,int flag=1.原创 2021-10-16 00:15:45 · 53 阅读 · 0 评论 -
6379:统计学生信息(使用动态链表完成)
#include<iostream>using namespace std;struct Node{ void showinfo() { cout<<x<<" "; } int x; Node *next;};int main(){ int n, x, k; Node *first, *tail=NULL, *p, *q; first = new Node; firs.原创 2021-09-30 19:10:16 · 273 阅读 · 0 评论 -
1748:约瑟夫问题
#include<iostream>using namespace std;//m=0|n=0int arr[300];int main(){ int n,m; while(cin>>n>>m) { if(n==0&&m==0)break; for(int i=0;i<n;i++) { arr[i] = i+1; } .原创 2021-09-23 18:06:42 · 212 阅读 · 0 评论 -
6379:统计学生信息(使用动态链表完成)
#老师写的:两个struct分的很清晰#include<iostream>#include<list>using namespace std;struct L{ string number; string name; char sex; int age; float score; string address;};struct Node{ L data; Node*next;};int main(){ //list <L> a;.原创 2021-09-23 17:52:10 · 297 阅读 · 0 评论 -
6377生日相同2.0 (Python版+C++版)
x = int(input())dict1 = {}for i in range(x): string = input() li_str = string.split(' ') name = li_str[0] month = int(li_str[1]) day = int(li_str[2]) t = (month, day) if dict1.get(t): dict1[t].append(name) else:.原创 2021-09-13 10:55:54 · 574 阅读 · 0 评论