C/C++
文章平均质量分 55
gg_gogoing
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python 基本内容
1. 包 import 模块名 这个包首先在当前目录找。 每个模块中可以用__name__判断是否为__main__来运行程序 创建包pack,建立一个文件夹然后创建__init__.py import pack.filename pack.filename.f() 引用包重命名 import pack as newname from cal import * #这样原创 2014-10-12 08:05:31 · 1012 阅读 · 0 评论 -
链表遍历**
对于一个链表遍历的遍历,我们判断是否到了最后一个位置一般是判断结构体中的next是否为NULL,其实也可以用**指针进行操作。#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; typedef struct Node{ int mx; stru原创 2015-09-22 08:07:14 · 486 阅读 · 0 评论 -
map vector struct+sort
#include<map> #include <vector> #include <cstdio> #include <cstring> #include <algorithm> #include <iostream> #define MAXN 10 using namespace std;typedef struct Node{ int x,y; string name;原创 2015-09-20 10:15:00 · 392 阅读 · 0 评论 -
python-webCrawler-01 urllib库
#-*-coding:utf-8-*- #!usr/bin/pythonimport urllib import urllib2 ''' Request urlopen(url, data, timeout) 第一个参数url即为URL,第二个参数data是访问URL时要传送的数据,第三个timeout是设置超时时间''' values = {} values['username'] = "ema原创 2015-10-17 16:05:32 · 469 阅读 · 0 评论 -
C语言-拾遗(2) 指针 && 声明
几个容易混淆的概念: 指针常量:即指针本身的值是不可改变的,而指针指向的变量的值是可以改变的; 常量指针:即指针指向的变量的值是不可改变的,而指针本身的值是可以改变的; 指向常量的指针 指针函数:函数,返回的是一个指针 函数指针:指针,指向一个函数(这里可以继续嵌套,指向的函数返回一个函数指针........) 数组指针:指针,指向数组 指针数组:数组内存放的是指针 指针与数组 1原创 2015-04-24 09:23:40 · 903 阅读 · 0 评论 -
STL学习(multiset Vector)
Vector比数组好用多了,毕竟是可变长的. 常用来建图. 需要掌握的就是构造函数,添加数据,删除数据.#include<set> #include<ctime> #include<cmath> #include<cstdio> #include<vector> #include<cstring> #include<iostream> #include<algorithm> #define ma原创 2015-05-16 11:10:06 · 1451 阅读 · 0 评论 -
C语言中一些不常用函数
time 这个用的最多就是随机数的时候,现在用一用其他特性.#include <stdio.h> #include <time.h>int main() { time_t sec; ///typedef long time_t struct tm * curTime; sec = time(NULL); ///获取时间,从1970.1.1到现在原创 2015-05-11 09:43:16 · 875 阅读 · 0 评论 -
C语言-拾遗(1) 关键字 && 运算符
关键字 extern static const typedef define sizeof union extern表示的是“已经存在一个变量,但是不在当前的编译单元内,需要在其他编译单元中寻找。” extern尽量写到.h文件中Extern语句频繁的用于在多个文件之间的跨范围数据传递 static会定义一个变量 1)修饰局部变量便存放在静态数据区 2)修饰全局变量原创 2015-04-24 09:23:34 · 833 阅读 · 0 评论 -
POJ 1521 Entropy 优先队列/multiset
优先队列实现完整哈夫曼树,一大段英文都是介绍哈夫曼树的。 外面用了一个pre来找parent,其实可以把这个项放入结构体中。 特别注意当有一个结点的情况不能用优先队列,另外判断下 #include #include #include #include #include #include using namespace std; #define maxn 256 s原创 2014-08-18 13:13:50 · 843 阅读 · 0 评论 -
C++ 获取文件夹下的所有文件名
char * filePath = "D:\\sample"; vector files; ////获取该路径下的所有文件 getFiles(filePath, files ); char str[30]; int size = files.size(); for (int i = 0;i < size;i++) { cout<<files[i].c_str()<<endl; }转载 2014-08-05 10:24:38 · 619 阅读 · 0 评论 -
POJ 3253 Fence Repair 题解(优先队列实现哈夫曼树)
题目大意: 一个农夫用一根长木板切成若干自己原创 2014-08-18 09:49:11 · 632 阅读 · 0 评论 -
ACM中的C++
为了更便捷的write code,acm 学习下C++。 注意:若要使用一个类的集合 eg: vetor<string>strings原创 2014-08-04 20:58:32 · 783 阅读 · 0 评论 -
IR中python 写倒排索引与查询处理
学习信息检索课程,老师让写一个倒排索引与查询处理的程序,于是抱着试试的心态自学python写了出来。 整个没有什么太大的算法技巧,唯一的就是查询处理那里递归函数正反两次反复查找需要多调试下。 数据结构: #-*-coding:utf-8-*- #!/usr/bin/python ''' 数据结构 建立索引 mydir 文档列表 onedoc 每一个文档 mydoc 当前查询的文档原创 2014-10-13 07:54:14 · 3554 阅读 · 0 评论 -
Redis-util 转换函数
#include "fmacros.h" #include <stdlib.h> #include <stdio.h> #include <string.h> #include <ctype.h> #include <limits.h> #include <math.h> #include <unistd.h> #include <sys/time.h> #include <float.h>#inc原创 2016-03-27 12:06:18 · 593 阅读 · 1 评论
分享