摘要: realloc,malloc,calloc的区别三个函数的申明分别是: void realloc(void ptr, unsigned newsize); void malloc(unsigned size); void calloc(size_t numE... 阅读全文
posted @ 2019-09-13 10:47 Kaniso_Vok 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 利用rand()函数来返回一个一随机数值,范围在0至RAND_MAX间。 返回0至RAND_MAX之间的随机数值,RAND_MAX定义在stdlib.h,(其值至少为32767)。 具体要看定义的变量类型,int整型的话就是32767。 此时产生的是一... 阅读全文
posted @ 2019-08-02 19:33 Kaniso_Vok 阅读(422) 评论(0) 推荐(0) 编辑
摘要: 单向链表(无头无循环)1.头插 cur->next=head;head=cur; 2.后插 cur->next=pos->next;pos->next=cur; 3.头删 tmp=head->next;free(head);head=tmp; 4... 阅读全文
posted @ 2019-07-22 16:48 Kaniso_Vok 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 项目头文件: #ifndef _LIST_H_#define _LIST_H_#include #includetypedef int LTDataType;typedef struct ListNode { LTDataType _data; ... 阅读全文
posted @ 2019-07-22 11:31 Kaniso_Vok 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 头文件如下: #ifndef _SLIST_H_#define _SLIST_H_typedef int SLTDataType;typedef struct SListNode{ SLTDataType data; struct SListN... 阅读全文
posted @ 2019-07-22 09:57 Kaniso_Vok 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 头文件如下 #ifndef _SEQLIST_H_#define _SEQLIST_H_// 顺序表的动态存储#include #include #include typedef int SLDataType;typedef struct SeqList ... 阅读全文
posted @ 2019-07-22 09:53 Kaniso_Vok 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-05-09 22:57 Kaniso_Vok 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 原题:一个数组中只有两个数字是出现一次,其他所有数字都出现了两次。找出这两个只出现一次的数字,编程实现。 此题要用到在数列中找出只出现一次的一个数字的方法参考https://blog.51cto.com/14232799/2382172 此题明显无法一次... 阅读全文
posted @ 2019-05-05 23:04 Kaniso_Vok 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 自带测试类源代码: public class TestFan { public static void main(String[] args) { Fan o1=new Fan(); Fan o2=new Fan(); o1.set... 阅读全文
posted @ 2019-04-29 18:15 Kaniso_Vok 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 自带测试类源代码: package testaccount;public class TestAccount{public static void main(String args[]){Account ss=new Account(1122,20000)... 阅读全文
posted @ 2019-04-29 18:13 Kaniso_Vok 阅读(106) 评论(0) 推荐(0) 编辑