单链表实现栈结构->使用环状双链表重构,增加了对链表操作的灵活程度。我相信只要有一点能够优化就值得去做。 “栈”的单链表实现 1 typedef int stack_element; 2 typedef struct stack_node { 3 stack_element element; 4 s ...
                            
                            
                                分类:
其他好文   时间:
2020-12-21 11:57:13   
                                阅读次数:
0
                             
                    
                        
                            
                            
                                    单链表 # 实现单链表 class Node(object): '''定义一个节点''' def __init__(self,data): # 因为每次都需要生成一个节点,写到类里面便于保存 self.data = data # 保存节点的值 self.next = None # 默认将节点的指向为 ...
                            
                            
                                分类:
其他好文   时间:
2020-07-26 00:06:05   
                                阅读次数:
67
                             
                    
                        
                            
                            
                                    插入、删除功能实现 /* * 使用单链表;每次插入大约需要比较N/2次; * 插入效率是O(N),删除表头元素效率是O(1) */ public class MySortQueue { // 使用单链表实现 private Entry root; private static class Entry ...
                            
                            
                                分类:
其他好文   时间:
2020-07-01 20:01:29   
                                阅读次数:
55
                             
                    
                        
                            
                            
                                    list实现, 头插带头结点的单链表实现链栈,两个队列实现栈 MAX_SIZE = 100 class MyStack1(object): """模拟栈""" def __init__(self): self.items = [] self.size = 0 def is_empty(self):  ...
                            
                            
                                分类:
编程语言   时间:
2020-06-29 20:07:08   
                                阅读次数:
65
                             
                    
                        
                            
                            
                                    实现单链表基础操作 package linkedlist; import java.util.NoSuchElementException; import java.util.Stack; /** * 单链表 */ @SuppressWarnings("all") public class Sing ...
                            
                            
                                分类:
编程语言   时间:
2020-06-15 23:15:23   
                                阅读次数:
97
                             
                    
                        
                            
                            
                                不带头结点: typedef struct LNode { int data; struct LNode *next; }LNode,*LinkList; //初始化一个空的单链表 bool InitList(LinkList &L) { L = NULL; return true; } void  ...
                            
                            
                                分类:
其他好文   时间:
2020-06-14 20:54:33   
                                阅读次数:
71
                             
                    
                        
                            
                            
                                    package 数据结构;import java.util.regex.Pattern;/** * @program: java_每天一题 * @description: 使用单链表实现栈 * 使用栈实现计算器:1,使用一个index遍历运算表达式字符串 * 2,如果是数字,存入数字栈 * 3.如果 ...
                            
                            
                                分类:
其他好文   时间:
2020-05-16 00:48:55   
                                阅读次数:
105
                             
                    
                        
                            
                            
                                1.单链表实现 slist.h 1 #ifndef _SLIST_H 2 #define _SLIST_H 3 4 typedef struct _slist_node 5 { 6 struct _slist_node *p_next; /* 指向下一个结点的指针 */ 7 }slist_node_ ...
                            
                            
                                分类:
其他好文   时间:
2020-05-12 09:35:44   
                                阅读次数:
49
                             
                    
                        
                            
                            
                                    终于把学的单链表塞进贪吃蛇里的. 相比于上一篇的数组,链表的理解程度可能高一些. 上一篇的链接 上代码: #include <stdio.h> #include <stdlib.h> #include <time.h> #include <conio.h> #include <windows.h>  ...
                            
                            
                                分类:
其他好文   时间:
2020-05-04 15:43:24   
                                阅读次数:
50
                             
                    
                        
                            
                            
                                    Python实现队列 单链表实现队列 循环双端链表实现队列 数组实现队列 ...
                            
                            
                                分类:
编程语言   时间:
2020-04-19 14:50:21   
                                阅读次数:
61