摘要:
realloc,malloc,calloc的区别三个函数的申明分别是: void realloc(void ptr, unsigned newsize); void malloc(unsigned size); void calloc(size_t numE... 阅读全文
摘要:
利用rand()函数来返回一个一随机数值,范围在0至RAND_MAX间。 返回0至RAND_MAX之间的随机数值,RAND_MAX定义在stdlib.h,(其值至少为32767)。 具体要看定义的变量类型,int整型的话就是32767。 此时产生的是一... 阅读全文
摘要:
单向链表(无头无循环)1.头插 cur->next=head;head=cur; 2.后插 cur->next=pos->next;pos->next=cur; 3.头删 tmp=head->next;free(head);head=tmp; 4... 阅读全文
摘要:
项目头文件: #ifndef _LIST_H_#define _LIST_H_#include #includetypedef int LTDataType;typedef struct ListNode { LTDataType _data; ... 阅读全文
摘要:
头文件如下: #ifndef _SLIST_H_#define _SLIST_H_typedef int SLTDataType;typedef struct SListNode{ SLTDataType data; struct SListN... 阅读全文
摘要:
头文件如下 #ifndef _SEQLIST_H_#define _SEQLIST_H_// 顺序表的动态存储#include #include #include typedef int SLDataType;typedef struct SeqList ... 阅读全文
摘要:
原题:一个数组中只有两个数字是出现一次,其他所有数字都出现了两次。找出这两个只出现一次的数字,编程实现。 此题要用到在数列中找出只出现一次的一个数字的方法参考https://blog.51cto.com/14232799/2382172 此题明显无法一次... 阅读全文