随笔分类 - C
摘要:#include <stdio.h> #include <time.h> #include <math.h> clock_t start, stop; //clock_t为clock()返回的变量类型 double duration; //记录被测函数运行时间,以秒为单位 int main(int argc, char **argv) { /* 不再测试范围内的准备工作写在clock()调用之前
阅读全文
摘要:起源: 今天在了解副作用side-effect的过程中,看到了下面的网页,把我带到了由printf引起的一系列问题,纠结了一整天,勉强弄懂。 第一个代码没什么好解释的。而第二个printf("return of swap is %d\tx=%d,y=%d\n",swap(&x,&y),x,y)居然是
阅读全文
摘要:将COMP20003中关于Graph的内容进行总结,内容来自COMP20003,中文术语并不准确,以英文为准。 Graph G = {V, E} 顶Vertices V: can contain information 边Edges E (links between vertices): can h
阅读全文
摘要:对COMP20003中的Priority queue部分进行总结。图片来自于COMP20003 queue队列,顾名思义特点先进先出 priority queue优先队列,出来的顺序按照优先级priority大小,越大(小)的先pop。 普通的方法: Unsorted array: Construc
阅读全文
摘要:需使用GCC编译器,关于MinGW的安装指南:https://people.eng.unimelb.edu.au/ammoffat/teaching/20005/Install-MinGW.pdf 单个.c文件且没有使用自定义头文件的编译,在命令行: • gcc -o programName pro
阅读全文
摘要:学习到的排序算法的总结,包括对COMP20003中排序部分进行总结,部分图片来自COMP20003 有部分内容来自http://www.cnblogs.com/eniac12/p/5329396.html 演示动画:https://www.cs.usfca.edu/~galles/visualiza
阅读全文
摘要:对树的知识进行整理,图片来自COMP20003。 首先树(tree)并不一定都是二叉树(binary tree),这里主讲二叉树。 二叉树: 二叉树:即1个节点(node)至多有2个子节点(child node)。 遍历(traversal): 分3种:前序遍历(Pre-order traversa
阅读全文
摘要:题目来自于COMP20003 Tutorial 2: Program m ing Challenge 2.2 The technology stack at Hidebound Inc. uses a subset of C w hich doesn't have the '.' or '->'op
阅读全文
摘要:Programming 1.3 In this problem, you'll be asked to find all the prime numbers from 1 to 1000. Prime numbers are used in allkinds of circumstances, pa
阅读全文
摘要:对材料C Programming Style for Engineering Computation的总结。 原文如下: 总结:
阅读全文

浙公网安备 33010602011771号