码迷,mamicode.com
首页 >  
搜索关键字:__next__    ( 15001个结果
【POJ】3630 Phone List
静态字典树。 1 #include 2 #include 3 #include 4 5 #define MAXN 10005 6 7 typedef struct Trie { 8 bool v; 9 Trie *next[10];10 Trie() {11 ...
分类:其他好文   时间:2014-06-28 09:39:33    阅读次数:171
LeetCode-Insertion Sort List (Python)
【问题】 Sort a linked list using insertion sort. 【代码】 # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Sol...
分类:编程语言   时间:2014-06-28 07:55:49    阅读次数:199
设计模式 - 迭代器模式(iterator pattern) 详解
迭代器模式(iterator pattern) 详解本文地址: http://blog.csdn.net/caroline_wendy迭代器模式(iterator pattern) : 提供一种方法顺序访问一个聚合对象中的各个元素, 而又不暴露其内部的表示;建立迭代器接口(iterator interface), 包含hasNext()方法和next()方法;不同聚合对象的具体的迭代器(concr...
分类:其他好文   时间:2014-06-28 07:43:35    阅读次数:306
给定单向链表的头指针和一个结点指针,定义一个函数在O(1)时间删除该结点
#include #include #include #include using namespace std; struct Node { int data; struct Node* next; }; struct Node* create_list(int len) { if (len <= 0) return NULL; struct Node* head; ...
分类:其他好文   时间:2014-06-27 23:54:36    阅读次数:311
全局匹配KMP算法
KMP算法是通过分析模式字符串,预先计算每个位置发生不匹配的时候,所需GOTO的下一个比较位置,整理出来一个next数组,然后在上面的算法中使用。本全局匹配KMP算法针对串的堆式存储数据结构# define MAXSIZE 45 //固定next数组的长度# define OK 1# define....
分类:其他好文   时间:2014-06-27 22:29:03    阅读次数:677
#Leet Code# LRU Cache
语言:C++描述:使用单链表实现,HeadNode是key=-1,value=-1,next=NULL的结点。距离HeadNode近的结点是使用频度最小的Node。 1 struct Node { 2 int key; 3 int value; 4 Node* next; 5...
分类:其他好文   时间:2014-06-27 18:48:42    阅读次数:209
【POJ】1451 T9
DFS+字典树。 1 #include 2 #include 3 #include 4 5 typedef struct Trie { 6 int v; 7 Trie *next[26]; 8 } Trie; 9 10 Trie root; 11 int ...
分类:其他好文   时间:2014-06-27 14:32:44    阅读次数:183
[leetcode] Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
分类:其他好文   时间:2014-06-27 12:14:44    阅读次数:191
【POJ】2503 Babelfish
字典树简单题。 1 #include 2 #include 3 #include 4 5 typedef struct Trie { 6 Trie *next[26]; 7 char str[15]; 8 } Trie; 9 10 Trie root;11 12 void c...
分类:其他好文   时间:2014-06-27 11:32:27    阅读次数:172
C++链表
#include #include using namespace std;class Student{public: Student (char *name); ~Student();public: char name[30]; Student *next; stat...
分类:编程语言   时间:2014-06-27 11:03:00    阅读次数:199
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!