码迷,mamicode.com
首页 >  
搜索关键字:struct stat    ( 35365个结果)
go interface理解
如果一只鸟长得像鸭子,走起路来像鸭子,叫起来也像鸭子,那么就把这只鸟叫做鸭子; golang中的interface就是上面这个意思,如果你定义了一个struct,它里面的方法和属性都和interface中的一样,那么可以说,这个...
分类:其他好文   时间:2014-08-23 15:28:11    阅读次数:139
编程之美——区间重合判断
将源区间按照x坐标大小排序,然后进行合并,使用二分查找目标区间x,y坐标在源区间中的分布,若两者分布于同一连续区间,则区间重合代码: 1 #include 2 #include 3 using namespace std; 4 5 struct section 6 { 7 int low;...
分类:其他好文   时间:2014-08-23 13:54:30    阅读次数:252
NYOJ2括号配对问题
括号配对是最基本的栈的问题,它是栈入门的经典题目,思路是,如果是左括号直接进栈,如果是右括号,这时就要比较栈顶的元素与他是否匹配,如果匹配则出栈,否则进栈,下面是代码的实现: 1 #include 2 #include 3 typedef struct stack{//定义栈来存储括号 4 ...
分类:其他好文   时间:2014-08-23 13:52:40    阅读次数:221
差分约束+SPFA+栈
#include #include #include #include #define INF 0x3f3f3f3fusing namespace std;struct node{ int u,v,w,next;}edge[150001];int head[30001],dis[30001],...
分类:其他好文   时间:2014-08-23 09:55:10    阅读次数:186
[二叉树的分层遍历] 倒序的树
比如下面一棵树 A B CD E F按照DEFBCA的顺序输出,即倒序分层并按照顺序输出。答,其实比较简单。我想到的办法是加一个栈,记录每一层的内容,最后输出。可能比较笨,如果有更好的办法,请告诉我。#include #include struct TreeNode{ ...
分类:其他好文   时间:2014-08-22 22:30:39    阅读次数:265
LeetCode--Populating Next Right Pointers in Each Node II
同上题:但是这题需要考虑好对当前节点的left和right的next指针如何设置。 1 /** 2 * Definition for binary tree with next pointer. 3 * struct TreeLinkNode { 4 * int val; 5 * Tre...
分类:其他好文   时间:2014-08-22 22:23:59    阅读次数:324
二维图形的矩阵变换(二)——WPF中的矩阵变换基础
在前文二维图形的矩阵变换(一)——基本概念中已经介绍过二维图像矩阵变换的一些基础知识,本文中主要介绍一下如何在WPF中进行矩阵变换。Matrix结构 在WPF中,用Matrix结构(struct类型)表示二维变换矩阵,它是一个3*3的数组,结构如下,由于第三列是常量0,0,1,因此并不作为公开属性,...
分类:其他好文   时间:2014-08-22 22:20:29    阅读次数:253
leetcode之add two numbers
/*#include using namespace std;  *//** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ cla...
分类:其他好文   时间:2014-08-22 19:46:39    阅读次数:147
POJ1007
2014-08-22题目意思:按照各个字符串的逆序数排序(稳定排序,即若A=B,则AB的顺序还是原来的样子)思路:求出每个字符串的逆序数后,排序输出即可代码://Memory Time // 352K 16MS #include #include typedef struct Dna{ in...
分类:其他好文   时间:2014-08-22 19:33:19    阅读次数:184
C语言实现通讯录
#include #include #include #include #include #define LEN sizeof(struct ab) #define ZIP 7 #define PHONE 7 #define MAX 100 struct ab { char name[10]; char addr[10]; char zip[ZIP]; char phone[PHONE];...
分类:编程语言   时间:2014-08-22 17:53:59    阅读次数:277
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!