
数据结构
猴子Tracy
一个想当黑客的爱唱歌的运动型灵魂画手
展开
-
数据结构笔记--1.1.3关于算法效率 计算多项式值
秦九韶算法f(x)=a[n]x^n+a[n-1]x^(n-1)+…+a[1]x+a[0]f(x)=(…((a[n]x+a[n-1])x+a[n-2])x+…+a[1])x+a[0]. clock() 计时函数的用法#include "stdafx.h"#include <iostream>#include <time.h>clock_t start, stop;double du原创 2016-12-05 09:48:44 · 372 阅读 · 0 评论 -
c++打开文件,以及搜索文件名二进制打开文件
普通打开文件方法//打开文件void OpenFile() { ifstream fin("Vincent.txt"); string s;//文件保存成字符串存在s中 string line;//文件每一行缓存 while (getline(fin, line))//按行读取数据 { //cout << "Read from file:原创 2017-02-21 19:09:48 · 965 阅读 · 0 评论 -
残缺棋盘问题
残缺棋盘问题的思路是分治法。首先分成四个象限,在没有残缺的三部分中间添加一块三格板,再分割,再添格板……很明显应该用递归来解决这个问题。分四个象限四种情况://分治法 递归void TileBoard(int fr, int fc, int dr, int dc, int size) { //fr fc原创 2017-02-24 12:49:33 · 1141 阅读 · 0 评论