最新文章列表

Binary Tree Right Side View

Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. For example: Given the following binary tree,    1        ...
KickCode 评论(0) 有517人浏览 2016-02-18 02:51

Binary Tree Level Order Traversal II

Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree {3,9,20,#,#,15,7},     ...
KickCode 评论(0) 有373人浏览 2016-02-07 05:16

Binary Tree Zigzag Level Order Traversal

Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between). For example: Given binary tree ...
KickCode 评论(0) 有436人浏览 2016-02-07 05:03

Binary Tree Level Order Traversal

Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree {3,9,20,#,#,15,7},     3    / \   9  20    /   \   ...
KickCode 评论(0) 有480人浏览 2016-02-07 04:47

【数据结构】【图论】BFS

BFS(Breadth First Search),中文名为宽度优先搜索,是横向遍历图的一种算法;这种算法必须借助队列才能够实现。 需求:输入edgeCount,startNode,edgeCount代表图有多少条边,startNode代表遍历的起点,接下来输入edgeCount组数据,每组有两个数node1与node2,代表一条边;最后输出BFS算法得到的序列,数和数之间使用空格隔开。 一 ...
狂盗一枝梅 评论(0) 有684人浏览 2016-01-22 22:37

POJ 3984 迷宫问题

  原题传送门:http://poj.org/problem?id=3984 迷宫问题 Time Limit: 1000MS   Memory Limit: 65536KB   64bit IO Format: %I64d & %I64u [Submit]   [Go Back]   [Status ...
hellojyj 评论(0) 有1578人浏览 2014-07-19 13:24

POJ 2243 Knight Moves

原题传送门:http://poj.org/problem?id=2243 Knight Moves Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11197   Accepted: 6318 Description A friend of you is doing resear ...
hellojyj 评论(0) 有1315人浏览 2014-07-16 13:35

Directed Graph

1.  Digraph: Set of vertices connected pairwise by directed edges.   2.  Digraph applications :   3.  Some digraph problems:     --  Path: Is there a directed path from s to t ?     --  Shortes ...
leonzhx 评论(0) 有1053人浏览 2013-11-22 20:54

zoj 1091 (bfs搜索)

链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=91   结题报告:因该说10多天没有A题了,今天过了一道比较水的题目,也算是来纪念一下吧,最近在刷搜索的时候感觉bfs有些题目是比较难的,象蛇和梯子那道题整整卡了我一个星期但是现在仍然没有过,标记一下,有时间在回来看一下! 这道题注意两个地方,一个是下标的值,一个是v ...
ren_hui 评论(0) 有1623人浏览 2013-09-28 21:25

poj 2157 Maze

   bfs.    先找小写字母,标记每种小写原来总共的exsit[], 能过搜到的小写字母用f[]标记,搜到一个,就加一,如果搜到的是大写字母,判断f[]>exsit[] 如果是,入队,如果不是,先保存起来,之后每次判断一下,如果满足f[]>exsit[]就入队。如果搜到‘G’结束搜索,得出答案。 #include<iostream> #include<cstd ...
bfs 
zhouxiaojie 评论(0) 有1187人浏览 2012-10-03 10:22

Python BTree 学习-广度优先搜索

不说别的见源码 #coding=utf-8 import sys, os import bisect import string class Entity(object): """data entity""" __slots__ = ("key", "valu ...
edisonlz 评论(0) 有3381人浏览 2012-08-27 09:41

Poj 3037 Skiing

Skiing Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3051   Accepted: 844   Special Judge Description ...
BFS 
zhengfuxinq 评论(0) 有8人浏览 2012-08-24 11:21

pku3083Children of the Candy Corn-模拟+bfs

pku3083Children of the Candy Corn 模拟的部分写了一下午 写bfs的时候还不知道什么是bfs…… 然后去写bfs模板题(记录在前两篇博客里) 然后贴bfs完成后就一直Runtime Error。。。 因为开的数组是 mp[40][40] ,然后数据里正好有 40*40 就杯具的Runtime Error了十多次 #inc ...
bfs 
lilai 评论(0) 有1160人浏览 2012-08-16 23:08

POJ 2251 Dungeon Master

题意:给你一个L.R.C的地牢(L*R*C的三维地牢)。求出从s到e的最短路。 Sample Input 3 4 5 S.... .###. .##.. ###.# ##### ##### ##.## ##... ##### ##### #.### ####E 1 3 3 S## #E# ### 0 0 0 Sample Output Escaped in 11 ...
BFS 
yingchifei 评论(0) 有12人浏览 2012-08-12 15:10

POJ 1324 Holedox Moving 贪食蛇

Description During winter, the most hungry and severe time, Holedox sleeps in its lair. When spring comes, Holedox wakes up, moves to the exit of its lair, comes out, and begins its new life.  ...
BFS 
yiheng 评论(0) 有1129人浏览 2012-08-10 22:23

【搜索之BFS + 剪枝】杭电 hdu 1175 连连看

/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2012 panyanyany All rights reserved. URL : http://acm. ...
panyanyany 评论(0) 有1404人浏览 2012-04-05 21:21

【搜索之BFS + 优先队列】杭电 hdu 1242 Rescue

  /* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2012 panyanyany All rights reserved. URL : http://ac ...
panyanyany 评论(0) 有1009人浏览 2012-04-04 16:09

【搜索之BFS】杭电 hdu 1240 Asteroids!

  /* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2012 panyanyany All rights reserved. URL : http://ac ...
panyanyany 评论(0) 有1105人浏览 2012-04-04 15:17

【搜索之BFS + 优先队列】杭电 hdu 1180 诡异的楼梯

  /* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2012 panyanyany All rights reserved. URL : http://ac ...
panyanyany 评论(0) 有1083人浏览 2012-04-03 15:03

最近博客热门TAG

Java(141744) C(73651) C++(68608) SQL(64571) C#(59609) XML(59133) HTML(59043) JavaScript(54919) .net(54785) Web(54514) 工作(54118) Linux(50905) Oracle(49875) 应用服务器(43289) Spring(40812) 编程(39454) Windows(39381) JSP(37542) MySQL(37267) 数据结构(36424)

博客人气排行榜

    博客电子书下载排行

      >>浏览更多下载

      相关资讯

      相关讨论

      Global site tag (gtag.js) - Google Analytics