- 博客(9)
- 资源 (4)
- 收藏
- 关注
原创 【LeetCode】Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link
2014-05-19 20:20:17 859
转载 【LeetCode】Reorder List
zhuhttp://www.programcreek.com/2013/12/in-place-reorder-a-singly-linked-list-in-java/
2014-05-19 15:55:26 677
原创 【LeetCode】LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:get and set.get(key) - Get the value (will always be positive) of the key if t
2014-05-19 08:54:49 928
原创 【华为编程大赛】洞穴逃生
洞穴逃生 描述: 精灵王子爱好冒险,在一次探险历程中,他进入了一个神秘的山洞。在洞穴深处,精灵王子不小心触动了洞穴内暗藏的机关,整个洞穴将很快塌陷,精灵王子必须尽快逃离洞穴。精灵王子的跑步速度为17m/s,以这样的速度可能是无法逃出洞穴的。庆幸的是精灵王子拥有闪烁法术,可在1s内移动60m,不过每次使用闪烁法术都会消耗魔法值10点。精灵王子的魔法值恢复的速度为4点/s,只有处在原地休息状态
2014-05-08 14:05:06 2948
原创 【华为编程大赛】实现一个开放的书名检索库
描述:实现一个开放的书名检索库,库中存储了若干个书名用户可以:1. 通过接口加入书名2. 指定搜索条件搜索库中符合条件的书名重要格式说明单词:由小写英文字母组成,不含其它字符书名:1. 由一个或多个单词组成2. 当包含多个单词时,单词间用一个空格分隔3. 第一个单词前和最后一个单词后没有空格4. 若只包含一个单词,则该单词前后均无空格搜索条件:
2014-05-06 21:10:27 3134 1
原创 【华为编程大赛】投票问题
输入若干候选人,以及投票,格式如下,输出(按输入候选人输入顺序)候选人以及得票,以及无效票数。Input:addCandidate xx1addCandidate xx2addCandidate xx3addCandidate xx4addCandidate xx5addCandidate xx6vote xx2vote xx2vote xx3vot
2014-05-06 21:08:00 1426 1
原创 【Union Find】JAVA implementation
import java.util.ArrayList;import java.util.Arrays;import java.util.HashMap;import java.util.Scanner;class UF{ private int[] id; private int count; public UF(int N) { count = N; id = n
2014-05-03 16:32:16 1510
原创 【LeetCode】Substring with Concatenation of All Words
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without an
2014-05-03 15:18:57 810
转载 【字符串动态规划】最长回文字串+交替字符串
Interleaving StringTotal Accepted: 7740 Total Submissions: 41615 Given s1, s2, s3, find whether s3 is formed by the interleaving ofs1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca"
2014-05-03 10:40:29 1493
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人