2013年8月15日

mac下配置openCV

摘要: 预备工作:1.下载Homebrew 在Terminal中输入:ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"2.安装cmake 在Terminal中输入:brew install cmake开始安装opneCV3.安装openCV 在Terminal中输入:brew install opencv如果出现Error: No available formula for opencv在输入brew install opencv前 先输入brew tap homebrew/science检查 Xcode->Pr 阅读全文
posted @ 2013-08-15 11:34 4.5.6 阅读(6493) 评论(0) 推荐(0) 编辑
2013年7月3日

K最短路 A*算法

摘要: POJ2449Remmarguts' Date 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int m,n,s,t,k; 7 #define M 100005 8 #define N 1005 9 #define INF 100000000 10 int dis[N]; 11 struct edge 12 { 13 int v,val,next;//边的终点,边权 14 edge(){} 15 edge(int _v,int _val,int _nex... 阅读全文
posted @ 2013-07-03 14:51 4.5.6 阅读(842) 评论(0) 推荐(0) 编辑
2013年7月2日

KMP算法

摘要: Matrix67:http://www.matrix67.com/blog/archives/115 阅读全文
posted @ 2013-07-02 14:04 4.5.6 阅读(160) 评论(0) 推荐(0) 编辑
2013年7月1日

北航复试机试题

摘要: 题目1167:数组排序数据量小得可怜,完全可以最用朴素的方法。本代码:快速排序,二分查找输出。#include typedef struct node{ int val,idx;}node;node c[10000];int d[10000];void swap(node *a,node *b){ int t; t = a->val; a->val = b->val; b->val = t;}void quick(int left,int right){ int l,r; l = left +1; r = right; if(left >=... 阅读全文
posted @ 2013-07-01 22:49 4.5.6 阅读(421) 评论(0) 推荐(0) 编辑

1385重建二叉树

摘要: 剑指offer题目1385:重建二叉树print1前序遍历,判断二叉树是否合法,即与输入的二叉树是否匹配,若不匹配输出No;print2后序遍历输出答案; 1 #include 2 int idx[1001],b[1001]; 3 typedef struct node 4 { 5 struct node * lson,*rson; 6 int value; 7 }node,*root; 8 node tree[1001]; 9 root build(int l,int r)10 {11 int i,midx,mval=10000;12 if(l > r)r... 阅读全文
posted @ 2013-07-01 21:49 4.5.6 阅读(376) 评论(0) 推荐(0) 编辑
2013年6月30日

二维数组中的查找

摘要: 题目1384:二维数组中的查找题目描述:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。思路:设需要查找的数为key,先二分查找最后一列不小于key的数的位置pos,然后二分查找pos行。 1 #include 2 int a[1001][1001]; 3 int n,m; 4 int binary1(int l,int r,int key,int col) 5 { 6 int mid = (l+r)/2; 7 if(l==r)return l; 8 ... 阅读全文
posted @ 2013-06-30 22:37 4.5.6 阅读(231) 评论(0) 推荐(0) 编辑
2013年6月27日

简单的单向链表

摘要: 简单的单向链表 ElemType READ(); int LENGTH(LinkList list); int ISEMPTY(LinkList list); LinkList FIND(LinkList list,ElemType item); int INSERTLINK(LinkList list,int i,ElemType item); void DELETELIST(LinkList list); 1 1 #include 2 2 #include 3 3 #include 4 4 typedef int ElemType; 5 5 //链结点类型... 阅读全文
posted @ 2013-06-27 19:40 4.5.6 阅读(241) 评论(0) 推荐(0) 编辑

Getting Started with WebRTC [note]

摘要: Getting Started with WebRTC原文RTCPeerConnection1.caller和callee互相发现彼此2.并且交换capabilities信息3.初始化session4.开始实时交换数据名词解释:信令:在客户端之间传递控制信息,通过控制信息处理客户端之间的发现、连接建立、连接维护和连接关闭等任务的机制。function initialize() { console.log("Initializing; room=99688636."); card = document.getElementById("card"); loc 阅读全文
posted @ 2013-06-27 16:10 4.5.6 阅读(2335) 评论(0) 推荐(0) 编辑
2013年6月26日

我的c漏洞

摘要: 传入指针参数 1 #include 2 #include 3 void READ(int *a) 4 { 5 scanf("%d",a); 6 } 7 int main() 8 { 9 int a;10 READ(&a);11 printf("a=%d\n",a);12 13 int b,*c,*d;14 scanf("%d",&b);15 //*c = b; //error,c还未分配空间16 c = &b;//right, c指向b17 print... 阅读全文
posted @ 2013-06-26 20:28 4.5.6 阅读(283) 评论(0) 推荐(0) 编辑
2013年6月25日

PeerConnection

摘要: Example(摘) 1 /*When two peers decide they are going to set up a connection to each other, they both go through these steps. The STUN/TURN server configuration describes a server they can use to get things like their public IP address or to set up NAT traversal. They also have to send data for the si 阅读全文
posted @ 2013-06-25 23:27 4.5.6 阅读(1106) 评论(0) 推荐(0) 编辑