`
844604778
  • 浏览: 551482 次
文章分类
社区版块
存档分类
最新评论
文章列表
369 - Combinations Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=305 Computing the exact number of ways thatNthings can be takenMat a time can be a great challenge whenNand/orMbecome very lar ...
readlink命令用来显示符号链接所指向的位置。 sh-# readlink /bin/cp /openbox/bin/cp sh-# sh-# echo $? 0 sh-# sh-# readlink /open/bin/cp sh-# sh-# echo $? 1 sh-# 使用ls -l命令也可以查看一个档案是否是链接档案, sh-# ls -l /openbox/bin/cp -rwxr-xr-x 1 root root 56132 Oct 17 2013 /openbox/bin/cp sh-# sh-# ls -l /bin/cp lrwxrwxr ...
man命令是用来获取在线参考手册的接口, 学习linux系统不可避免的会需要通过man命令来查看命令或系统函数等的用法。 但是一直以来都只是通过man来查看命令的使用方法, 直到无意间发现man也可以用来查看系统调用或库函数的用法。 虽然知道如此,但却一直不得其意。 于是带着好奇心, # man man 才发现, 原来使用man命令查找时,可以通过指定page number来查看相应的用法; 如果没有指定page number,那默认会按序查找然后显示第一个查到的用法。 关于page number与具体用法的对应关系是: 1 可执行程序或shell命令 2 系统调用 3 ...
如果你经常读一些关于提高工作效率或时间管理类的博客,一定听说过番茄时间管理法(Pomodoro Technique)。这是一种极好的帮助你集中注意力、获得更高工作效率的方法。 基本上,它的实施方法是这样的: 1. 确定你想要做什么(例如:翻译一篇外文)。
首先,看一下平衡二叉树的定义: 平衡二叉树(Balanced Binary Tree)又被称为AVL树(有别于AVL算法),且具有以下性质:它是一 棵空树或它的左右两个子树的高度差的绝对值不超过1,并且左右两个子树都是一棵平衡二叉树。 思路:利用递归的思想 代码: int DepthTree(BSTreeNode *pbs) { if (pbs==NULL) return 0; else { int leftLength=DepthTree(pbs->left); int ...
首先,看一下完全二叉树的定义: 若设二叉树的深度为h,除第 h 层外,其它各层 (1~h-1) 的结点数都达到最大个数,第 h 层所有的结点都连续集中在最左边,这就是完全二叉树。 思路:可以采用广度优先的遍历方法,从根节点 ...
首先看一下二叉搜索树的定义: 或者是一棵空树,或者是具有下列性质的二叉树: 若它的左子树不空,则左子树上所有结点的值均小于它的根结点的值;若它的右子树不空,则右子树上所有结点的值均大于它的根结点的值;它的左、右子树也分别为二叉排序树。 原理:一棵二叉搜索树的中续遍历结果是从小到大排序好的,反之亦然。 代码:时间复杂度O(n),空间复杂度O(1)
首先我们应该来明确一下大小端的区别: 大端:数据的低位保存在高地址,高位保存在低地址。优势是符号位存在于第一个字节,容易判断正负。 小端:数据的低位保存在低地址,高位保存在高地址。优势是强制转换数据不需要调整字节内容。 代码: void IsBigEndian() { short int a = 0x1234; char b = *(char *)&a; if(b == 0x12){ //大端 }else{ //小端 } }
412 - Pi Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=353 Professor Robert A. J. Matthews of the Applied Mathematics and Computer Science Department at the University of Aston in Birmingham, ...
412 - Pi Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=353 Professor Robert A. J. Matthews of the Applied Mathematics and Computer Science Department at the University of Aston in Birmingham, ...
SlidingMenu简介: SlidingMenu的是一种比较新的设置界面或配置界面效果,在主界面左滑或者右滑出现设置界面,能方便的进行各种操作.目前有大量的应用都在使用这一效果。如Evernote、Google+、Foursquare等,国内的豌豆夹,人人,360手机助手等都使用SlidingMenu的界面方案。 项目下载地址:https://github.com/jfeinstein10/SlidingMenu注意: SlidingMenu依赖于另一个开源项目ActionBarSherlock,所以需要将ActionBarSherlock添加作为SlidingMenu的库工程,否则会报资 ...
1. 引言 一般我们编程的时候,函数中形式参数的数目通常是确定的,在调用时要依次给出与形式参数对应的实际参数。但在某些情况下我 们希望函数的参数个数可以根据需要确定,因此c语言引入可变参数函数。典型的可变参数函数的例子有printf()、scanf()等。 例如: printf(“hello,world!”);其参数个数为1个。 printf(“a=%d,b=%s,c=%c”,a,b,c);其参数个数为4个。 如何编写可变参数函数呢?我们首先来看看printf函数原型是如何定义的。 在linux下,输入man 3 printf,可以看到prinf函数原型如下: SYNOPSI ...
10056 - What is the Probability ? Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=115&page=show_problem&problem=997 Probability has always been an integrated part of computer algorithms. Where the deterministic algorithms ...
10056 - What is the Probability ? Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=115&page=show_problem&problem=997 Probability has always been an integrated part of computer algorithms. Where the deterministic algorithms ...
iwpriv是linux下配置无线网络的工具。 1. 使用ifconfig查看无线网卡的名字, sh-# ifconfig eth0 Link encap:Ethernet HWaddr 00:0C:E7:06:00:00 inet addr:192.168.0.162 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4108 errors:0 dropped:2269 overruns:0 frame:0 TX packet ...
Global site tag (gtag.js) - Google Analytics