【题目】Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not pos...
分类:
其他好文 时间:
2015-05-06 21:04:30
阅读次数:
130
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 ...
分类:
系统相关 时间:
2015-05-06 19:46:44
阅读次数:
258
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu...
分类:
系统相关 时间:
2015-05-06 10:42:19
阅读次数:
132
https://leetcode.com/problems/implement-strstr/Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is ...
分类:
其他好文 时间:
2015-05-06 01:22:53
阅读次数:
167
problem:
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 po...
分类:
系统相关 时间:
2015-05-05 19:42:16
阅读次数:
204
Reverse a singly linked list.
click to show more hints.
Hint:
A linked list can be reversed either iteratively or recursively. Could you implement both?
思路:
迭代的方式,可以使用一个哨兵节点,方便反转;...
分类:
其他好文 时间:
2015-05-05 19:34:55
阅读次数:
126
在内核代码中看到strstr函数:
mode = strstr(boot_command_line, "D:");
应该是一个字符串处理函数,使用man命令查看下给出如下解释:
SYNOPSIS
#include
char *strstr(const char *haystack, const char *needle);
#define ...
分类:
系统相关 时间:
2015-05-05 16:31:15
阅读次数:
263
Reverse a singly linked list.click to show more hints.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both? ...
分类:
其他好文 时间:
2015-05-05 16:04:23
阅读次数:
118
Reverse a singly linked list.click to show more hints.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?之...
分类:
其他好文 时间:
2015-05-05 14:01:06
阅读次数:
105
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next...
分类:
其他好文 时间:
2015-05-04 13:27:57
阅读次数:
115