
C语言
Thomas_YiSaYa
这个作者很懒,什么都没留下…
展开
-
The C Programming Language Exercise 2_6
/** Exercise 2-6 Write a function setbits( x, p, n, y ) that* returns x with the n bits that begin at position p set to* the rightmost n bits of y, leaving the other bits unchanged.** fduan,原创 2016-02-19 10:53:32 · 761 阅读 · 0 评论 -
非递归 做八皇后问题--利用遍历函数(next_permetation)
八皇后问题:#include#include#includeusing namespace std;class EightQueen{public: EightQueen() { num = 1; valid_result = 0; chessboard.resize(num,0); } EightQueen(int count) { valid_r转载 2016-04-25 17:01:13 · 451 阅读 · 0 评论 -
转:关于链式表达式
最近在看代码,据说代码的质量很重要,看了一些代码的试题和原因。已知strcpy函数的原型是 char *strcpy(char *strDest, const char *strSrc);其中strDest是目的字符串,strSrc是源字符串。(1)不调用C++/C的字符串库函数,请编写函数strcpy char *strcpy(char *strDes转载 2016-04-10 20:13:20 · 673 阅读 · 0 评论 -
最短路径—Dijkstra算法和Floyd算法
最短路径—Dijkstra算法和Floyd算法Dijkstra算法1.定义概览Dijkstra(迪杰斯特拉)算法是典型的单源最短路径算法,用于计算一个节点到其他所有节点的最短路径。主要特点是以起始点为中心向外层层扩展,直到扩展到终点为止。Dijkstra算法是很有代表性的最短路径算法,在很多专业课程中都作为基本内容有详细的介绍,如数据结构,图论,运筹学等等。注意该算法要求图中不转载 2016-04-26 23:12:35 · 464 阅读 · 0 评论