上一篇刚刚学习了C++图的实现,今天对深度优先搜索(DFS)进行了一定学习,并作出一定实现。在本文中图的实现,以及相应的函数调用(如获得第一个邻接顶点、获得下一个邻接顶点等)均是基于上文中的实现,故如果想参考测试代码,还需导入上文中相应的类定义。关于C++图的实现可参考此处,这里实现了对图的邻接表....
分类:
其他好文 时间:
2014-05-08 09:06:19
阅读次数:
296
Given a sorted array and a target value, return
the index if the target is found. If not, return the index where it would be if
it were inserted in or...
分类:
其他好文 时间:
2014-05-08 07:29:02
阅读次数:
285
#include
#include
using namespace std;
class Point
{
public:
Point(double x=0,double y=0);
void setPoint(double,double);
double getx()
{
return x;
}
double gety()
...
分类:
其他好文 时间:
2014-05-08 04:44:47
阅读次数:
237
一、TestCpp实例ActionsTest 模块中ActionManual动作
素材原图:
动作效果图:
程序代码:
bool HelloWorld::init()
{
if ( !CCLayer::init() )
{
return false;
}
CCSize visibleSize = CC...
分类:
其他好文 时间:
2014-05-08 04:34:36
阅读次数:
318
package org.mark.file;
import java.io.File;
/**
* File类的基本操作之读出全部文件夹路径
* 如果给定一个目录,要求将此目录中的全部文件都列出来
* 使用递归
*/
public class TestChare {
/**
* @param args
*/
public static void main(String[]...
分类:
其他好文 时间:
2014-05-08 03:53:29
阅读次数:
259
#include
#include
using namespace std;
class Point
{
public:
Point(double x=0,double y=0);
void setPoint(double,double);
double getx()
{
return x;
}
double gety()
...
分类:
其他好文 时间:
2014-05-08 03:42:17
阅读次数:
273
生成随机字符生成随机字符就是生成0到65535之间的一个随机整数,因为0<=Math.random()<1.0,必须在65535+1(int)(Math.random()*(65535+1))随机生成小写字母publicclassRandomCharacter{
publicstaticchargetRandomCharacter(charch1,charch2){
return(char)(ch1+Math.ran..
分类:
编程语言 时间:
2014-05-08 03:19:35
阅读次数:
435
问题描述
给定(可能是负的)整数序列A1, A2,...,AN, 寻找(并标识)使Sum(Ak)(k >=i, k <= j)的值最大的序列。如果所有的整数都是负的,那么连续子序列的最大和是零。...
分类:
其他好文 时间:
2014-05-08 01:49:14
阅读次数:
273