静态全局变量在声明它的整个文件都是可见的,而在文件之外是不可见的;静态变量都在全局数据区分配内存,包括后面将要提到的静态局部变量。对于一个完整的程序,在内存中的分布情况如下图:代码区 //low address全局数据区堆区栈区 //high address一般程序把新产生的动态数据存放在堆区,函数...
分类:
其他好文 时间:
2015-04-27 12:36:41
阅读次数:
192
How to change the SRP data is a very imperative for most bluetooth low energy use case. But in official Texas Instruments(TI) example code, there is no demonstration for this purpose. In here, I note...
分类:
其他好文 时间:
2015-04-27 00:29:29
阅读次数:
489
/**
* 求从1到参数n中的各个数字中,1出现的次数和
*
* @param n
* @return
*/
public static int countOne(int n) {
int factor = 1;
int cur;
int low;
int high;
int cnt = 0;
while ((n / factor) != 0) {
...
分类:
其他好文 时间:
2015-04-26 10:55:13
阅读次数:
144
快速排序 1 public class QuickSort{ 2 3 public static int Partition(int[] a,int low,int high){ 4 int pivotkey=a[low]; 5 while(low=...
分类:
编程语言 时间:
2015-04-26 01:13:39
阅读次数:
141
分析:本题判断一个图是否是有向强连通分量,这里使用tarjan算法求解。
#include
#include
#include
using namespace std;
vector map[10002];
stack tarjan_stack;
int low[10002];
int dfn[10002];
bool vis[10002];
int cnt,pos;
void Init(i...
分类:
编程语言 时间:
2015-04-25 13:46:55
阅读次数:
150
--18、 假设使用如下命令建立了一个grade表:create table grade(low int,upp int,rank char(1))insert into grade values(90,100,'A')insert into grade values(80,89,'B')in...
分类:
数据库 时间:
2015-04-25 10:39:16
阅读次数:
225
先写上代码:
#include
using namespace std;
typedef struct maximum
{
int left;
int right;
int sum;
}Maximum;
Maximum* FIND_MAX_CROOSING_SUBARRAY(int *A,int low,int mid,int high);
Maximum* FIND_MAXI...
分类:
编程语言 时间:
2015-04-24 14:19:44
阅读次数:
201
无源汇网络流(有向图):
最终的最大流需要是一个循环体,流量在内部循环流动。
必须流和自由流的定义:
首先设每条边上界为flow,下界为low,那么就存在low的必须流和flow-low的自由流。
「无源汇」有上下界的「可行」流:
建图:
记录每个点的所有流入的必须流in和所有流出的必须流out。
然后新图先设立一个超级源点和一个超级汇点,
对于每条边,保留其自由流的容...
分类:
其他好文 时间:
2015-04-24 10:40:41
阅读次数:
97
1.二分查找 1 public class BubbleSort { 2 public static int binarySerach(int[] a,int value){ 3 int low=0; 4 int high=a.length-1; 5 ...
分类:
其他好文 时间:
2015-04-24 00:48:26
阅读次数:
310
//快速排序,第一步确定一个关键值key(一般设置为第一个元素),一次快排基本思路是将比key小的数放在key的左边将比key大的数放在key右边,于是完成一次快排接下来对key左边和右边分别递归采用同样方法算法步骤: 1.选择一个基准key(一般选第一个元素) 2设定两个指针low和high,初始...
分类:
其他好文 时间:
2015-04-23 21:35:08
阅读次数:
183