callmepicacho / data-structres Goto Github PK
View Code? Open in Web Editor NEW浙江大学《数据结构》上课笔记 + 数据结构实现 + 课后题题解
License: MIT License
浙江大学《数据结构》上课笔记 + 数据结构实现 + 课后题题解
License: MIT License
上课Demo 2.数组存储的线性表.c中的ElementType FindKth(int K,List L)第三行return;应为return -1;
7-1 Maximum Subsequence Sum这道题的代码在OJ有一组数据过不了,题目要求的是如果全为负数,则输出0,你的代码是只要最大和小于0则输出0。
还有就算我有个疑问,当最大和前面有一串0的时候,我感觉你这个程序也会出错,但是OJ在判这组数据的时候你的代码是对的,而我选择条件是<=时清零,但在这组数据却会出错。我不太理解,倘若你有时间可否交流一下这个问题
void Delete(int i,List L){
int j;
if(i < 0 || L->Last <i){ //位置越界,而删除最多到 L->Data[L->Last]
printf("L->Data[%d]不存在元素",i);
return;
}
for(j=i;j<=L->Last;j++) // 从前往后依次向前挪一个,将 a[i] 覆盖了
L->Data[j-1] = L->Data[j];
L->Last--; // Last仍然指向最后元素
return;
}
你这 传入的 i 是 下表,所以
for(j=i;j<=L->Last;j++) // 从前往后依次向前挪一个,将 a[i] 覆盖了
L->Data[j-1] = L->Data[j];
应该改成
for(j=i+1;j<=L->Last;j++) // 从前往后依次向前挪一个,将 a[i] 覆盖了
L->Data[j-1] = L->Data[j];
循环队列一直添加元素,理论上队满了,但是没有提示队满。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.