码迷,mamicode.com
首页 >  
搜索关键字:malloc    ( 2467个结果
数据结构(一)线性表循环链表相关补充
(一)合并两个循环链表 (二)判断单链表中是否有环 方法一:使用两个指针,循环嵌套,A指针在外层循环,一步一步向下走,B指针在内层循环,循环到A的位置,当两者的位置相同时判断走的步数是否一致,不一致则代表有环。且能够得到准确的环路节点。其中A是要将链表从头走到尾,B是一直在内层进行循环,时间复杂度为 ...
分类:其他好文   时间:2018-08-05 23:29:51    阅读次数:243
基数排序
#include #include #include typedef int ElementType; #define DIGIT 31 #define RADIX_10 10 int GetNumInPos(ElementType Num,int Pos) { ElementType Temp =... ...
分类:编程语言   时间:2018-08-05 22:39:30    阅读次数:198
堆排序
1 #include <stdio.h> 2 #include <malloc.h> 3 4 #define LeftChild(i) (2*(i)+1) 5 6 typedef int ElementType; 7 8 void SwapTwoNum(ElementType *Num_1,Elem ...
分类:编程语言   时间:2018-08-05 22:39:21    阅读次数:228
大数阶乘(结果)
#include #include #include #define MaxSize 1000000 char *BigNumFactorial(int InputOrderMultiplier) { int *TempResult = malloc(MaxSize*sizeof(int)); in... ...
分类:其他好文   时间:2018-08-05 22:37:35    阅读次数:251
大数乘法
#include #include #include #define MaxSize 1000 char *TwoBigNumMult(char *InputMultiplier_1,char *InputMultiplier_2) { int *TempResult = malloc(MaxSiz... ...
分类:其他好文   时间:2018-08-05 22:37:14    阅读次数:184
大数加法
#include #include #include #define MaxSize 1000 char *TwoBigNumPlus(char *InputAddend_1,char *InputAddend_2) { char *Result = malloc(MaxSize*sizeof(ch... ...
分类:其他好文   时间:2018-08-05 22:33:20    阅读次数:172
单链表的学习
1.链表的定义: 2.创建空单列表 3.销毁单链表 4.求表长 5.查找操作 (1)按顺序查找 (2)按值查找 6.插入 7.删除 以上是单链表的一些基本操作。 ...
分类:其他好文   时间:2018-08-05 14:58:06    阅读次数:220
Program terminated with signal 6, Aborted,有可能啥原因呢?
Program terminated with signal 6, Aborted,有可能啥原因呢?其中一种原因就是事实上的OOM(虽然/var/log/message中没有标明操作系统kill了进行,应该是进程内部初始化已申请内存时报错了,因为malloc的申请会被OS尽可能延后的分配,所以很有可 ...
分类:其他好文   时间:2018-08-04 18:53:16    阅读次数:4890
OpenACC 书上的范例代码(Jacobi 迭代),part 3
? 使用Jacobi 迭代求泊松方程的数值解 ● 使用 data 构件,强行要求 u0 仅拷入和拷出 GPU 各一次,u1 仅拷入GPU 一次 ● 输出结果,在 Windows 里运行结果如下,在 WSL 里运行时间为 959 ms ● 在 Nvvp 中的结果,非常清晰了 ● 将 tempp 放到了 ...
分类:其他好文   时间:2018-08-04 00:58:50    阅读次数:255
链表节点的删除(无重复)
链表的删除,需要两指针联动,作用是为了断链与挂链,因为现在链表是单向的,无法表示上一个结点,需要考虑删除的结点是否是头结点,无需考虑删除的是否是尾结点
分类:其他好文   时间:2018-08-03 10:38:59    阅读次数:122
2467条   上一页 1 ... 56 57 58 59 60 ... 247 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!