#include#include#includeint k,h[110],mark;struct M{ int data; struct M *next;}*head[110];void init(){ int i; for(i = 0; i next = NULL; ...
分类:
其他好文 时间:
2014-06-17 00:58:16
阅读次数:
315
1.判断单链表是否有环 使用两个slow, fast指针从头开始扫描链表。指针slow 每次走1步,指针fast每次走2步。如果存在环,则指针slow、fast会相遇;如果不存在环,指针fast遇到NULL退出。 就是所谓的追击相遇问题: 2.求有环单链表的环长 在环上相遇后,记录第一次...
分类:
其他好文 时间:
2014-06-17 00:42:49
阅读次数:
260
1、 如果仅需要播放波形文件wav格式的声音,很简单,只需一句话:
PlaySound(TEXT("Data\\1.wav"), NULL, SND_FILENAME | SND_ASYNC | SND_LOOP);在这里只提供方法,详细问题自己去探索。
完整C语言代码:
#include
#pragma comment(lib, "Winmm.lib")
int main(int ar...
分类:
编程语言 时间:
2014-06-16 22:44:47
阅读次数:
353
给出一颗二叉树,找到两个值的最小公共节点。
假设两个值都会在树中出现。如果可能不会出现的话,也很简单,就查找一遍看两个值是否在树中就可以了。如果不在就直接返回NULL。
基本思想:就是在二叉树中比较节点值和两个值的大小,如果都在一边(左边或者右边)那么就往下继续查找,否则就是都在同一边了,那么就可以返回这个节点了,这个节点就是最低公共单亲节点了。
参考:http://www.geeksfor...
分类:
其他好文 时间:
2014-06-16 21:06:22
阅读次数:
235
public static void downFile(final String url){
new Thread(){
public void run(){
FileOutputStream os=null;
try{
InputStream input=null;
...
分类:
移动开发 时间:
2014-06-16 20:47:47
阅读次数:
286
XMLHttpRequest cannot load file~~~~~~~Origin 'null' is therefore not allowed access
最近在做框架的时候,需要加载.html文件和.json文件的时候出现了一下一个错误...
分类:
数据库 时间:
2014-06-16 20:26:18
阅读次数:
266
题目
Implement strStr().
Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.
方法
只需要遍历一遍即可。
public String strStr(String...
分类:
其他好文 时间:
2014-06-16 19:07:08
阅读次数:
188
linux:禁pingvim/proc/sys/net/ipv4/icmp_echo_ignore_all0代表允许1代表禁止ping.sh#!/bin/bash
foriin{2..5};
do
host=122.152.172.$i
ping-c2$host>/dev/null
if[$?=0]
then
echo"122.152.172.$iisconnected"
else
echo"122.152.172.$iisnotconnected"
fi
done显示结果..
分类:
其他好文 时间:
2014-06-16 15:37:33
阅读次数:
235
package上机练习;
publicclassA02class{
Stringnames[]=newString[30];
publicvoidshowA(Stringname){
for(inti=0;i<names.length;i++){
if(names[i]==null){
names[i]=name;
break;
}
}
}
publicvoidshowB(){
System.out.println("\t客户列表显..
分类:
编程语言 时间:
2014-06-16 15:26:12
阅读次数:
287
不知道怎么起标题,就这样了。目前主要讲两个方面内容:代码方式 设置RadioButton的 android:button 、 android:background 等属性为 @null;代码方式 通过布局模板动态创建固定参数的RadioButton等控件对象1、代码设置@null// 这里不能用nu...
分类:
其他好文 时间:
2014-06-16 13:35:24
阅读次数:
204