上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 43 下一页

2016年3月13日

3. Longest Substring Without Repeating Characters (ASCII码128个,建立哈西表)

摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo 阅读全文

posted @ 2016-03-13 11:00 joannae 阅读(207) 评论(0) 推荐(0) 编辑

2016年3月12日

2. 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 阅读全文

posted @ 2016-03-12 21:19 joannae 阅读(232) 评论(0) 推荐(0) 编辑

1. Two Sum (快速排序;有序数组的查找: 两个指针; 哈希表)

摘要: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文

posted @ 2016-03-12 08:57 joannae 阅读(414) 评论(0) 推荐(0) 编辑

2016年1月13日

动态规划算法的应用模型

摘要: 线性模型【例题】在一个夜黑风高的晚上,有n(n <= 50)个小朋友在桥的这边,现在他们需要过桥,但是由于桥很窄,每次只允许不大于两人通过,他们只有一个手电筒,所以每次过桥的两个人需要把手电筒带回来,i号小朋友过桥的时间为T[i],两个人过桥的总时间为二者中时间长者。问所有小朋友过桥的总时间最短是多... 阅读全文

posted @ 2016-01-13 10:59 joannae 阅读(2136) 评论(0) 推荐(0) 编辑

2015年12月31日

207. Course Schedule(Graph; BFS)

摘要: There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to... 阅读全文

posted @ 2015-12-31 16:44 joannae 阅读(272) 评论(0) 推荐(0) 编辑

2015年12月28日

206. Reverse Linked List (List)

摘要: Reverse a singly linked list./** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) :... 阅读全文

posted @ 2015-12-28 19:08 joannae 阅读(161) 评论(0) 推荐(0) 编辑

205. Isomorphic Strings (Map)

摘要: Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences... 阅读全文

posted @ 2015-12-28 18:53 joannae 阅读(171) 评论(0) 推荐(0) 编辑

2015年12月25日

204. Count Primes (Integer)

摘要: Count the number of prime numbers less than a non-negative number, n.思路:寻找质数的方法class Solution {public: int countPrimes(int n) { int num = 0;... 阅读全文

posted @ 2015-12-25 06:50 joannae 阅读(169) 评论(0) 推荐(0) 编辑

2015年12月17日

203. Remove Linked List Elements (List)

摘要: Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 -->... 阅读全文

posted @ 2015-12-17 09:06 joannae 阅读(158) 评论(0) 推荐(0) 编辑

202. Happy Number (INT)

摘要: Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer... 阅读全文

posted @ 2015-12-17 08:31 joannae 阅读(348) 评论(0) 推荐(0) 编辑

上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 43 下一页

导航