算法
文章平均质量分 71
crystal_tyan
沙漠的另一边会是什么,又一片沙漠罢了
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
深度优先算法生成迷宫——Python实现
import random#warning: x and y confusingsx = 10sy = 10dfs = [[0 for col in range(sx)] for row in range(sy)]maze = [[' ' for col in range(2*sx+1)] for row in range(2*sy+1)]#1:up 2:down 3:left 4原创 2015-01-08 13:42:25 · 6102 阅读 · 1 评论 -
leetcode [Clone Graph] Java
OJ's undirected graph serialization:Nodes are labeled uniquely.We use # as a separator for each node, and , as a separator for node label and each neighbor of the node.As an example, consider th原创 2015-02-02 20:24:15 · 541 阅读 · 0 评论 -
斐波那契数列之动态规划
有这样一道OJYou are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?https://oj.leetcode.c原创 2015-01-14 09:02:43 · 759 阅读 · 0 评论 -
Leetcode [Min Stack] java
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get原创 2015-02-03 10:00:55 · 538 阅读 · 0 评论 -
leetcode [Validate Binary Search Tree] java
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the node's key.The原创 2015-02-05 11:49:39 · 472 阅读 · 0 评论
分享