码迷,mamicode.com
首页 >  
搜索关键字:struct enum    ( 22969个结果
外接圆模板
double dis(Point a){ return a.x*a.x+a.y*a.y;}struct Circle Circumcircle(){ Circle tmp; double a,b,c,c1,c2; double xa,ya,xb,yb,xc,yc; a ...
分类:其他好文   时间:2014-07-06 17:39:21    阅读次数:153
枚举,给枚举赋值
/**************枚举*****************///public enum Colors{//Red,Yellow,Blue,Black,White//}//public static void main(String[] args) {//Colors c = Colors....
分类:其他好文   时间:2014-07-06 17:01:16    阅读次数:204
poj 2376 Cleaning Shifts
DescriptionFarmer John is assigning some of his N (1 2 #include 3 #include 4 using namespace std; 5 int vis[1100009]; 6 int a,b; 7 struct node 8 { 9 ....
分类:其他好文   时间:2014-07-06 14:50:25    阅读次数:155
[Leetcode][Tree][Flatten Binary Tree to Linked List ]
按照前序遍历的顺序把树用right连起来。本来想了半天,一点思路都没有,总觉得Inplace的解法一般都非常巧妙。后来我突发灵感,决定用一个变量记录当前访问到哪个点,真是太机智了~~ 1 /** 2 * Definition for binary tree 3 * struct TreeNode.....
分类:其他好文   时间:2014-07-06 14:02:26    阅读次数:168
读REDIS数据结构
一.DICT主要有两个问题:1.散列冲突,解决办法是拉链法typedef struct dictEntry { void *key; union { void *val; uint64_t u64; int64_t s64; } v; ...
分类:其他好文   时间:2014-07-06 13:53:52    阅读次数:161
[Leetcode][BST][Convert Sorted Array to Binary Search Tree]
把一个排好序的vector转换为一颗二分查找树。很简单的题目,递归即可,保证边界不要出错。 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; ...
分类:其他好文   时间:2014-07-06 12:53:50    阅读次数:174
点-双连通分量模板
by:白书 #define M 10000 int pre[M],dfs_clock,iscut[M],low[M],bcc_cnt,bccno[M]; vectorG[M],bcc[M]; struct Edge { int u,v; Edge(int from,int to) { u=from; v=to; } }; stack S; int dfs(int u,int fa...
分类:其他好文   时间:2014-07-06 11:29:32    阅读次数:198
[Leetcode][Tree][Path Sum]
很简单的一道题,判断和为sum的路径是否存在。结果WA了两次,一次是由于没有考虑清楚深搜停止的条件,另外一次是由于没有考虑到Path必须是从root到leaf的。 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * ...
分类:其他好文   时间:2014-07-05 22:39:11    阅读次数:253
[Leetcode][Tree][Sum Root to Leaf Numbers]
非常简单的一个题,和path sum非常类似。 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *rig...
分类:其他好文   时间:2014-07-05 22:03:48    阅读次数:251
【Nginx】基本数据结构
整型的封装typedef intptr_t ngx_int _t;//有符号整型typedef uintptr_t ngx_uint_t;//无符号整型字符串的封装typedef struct{ size_t len; u_char *data; }ngx_str_t;链表容器...
分类:其他好文   时间:2014-07-05 20:55:25    阅读次数:252
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!