
DataStructure
文章平均质量分 75
0TST0
whu-cs硕士在读
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Data Structure-2 Queue 循环队列,用数组实现
1. 队列基础 Queue. A queue supports the insert and remove operations using a first-in first-out (FIFO) discipline. By convention, we name the queue insert operation enqueue and the remove operation deque原创 2017-07-20 09:18:56 · 397 阅读 · 0 评论 -
Data structure-4 双向链表 DoubleLinkedList--Java语言实现
1. 双向链表简介 Doubly Linked List is a variation of Linked list in which navigation is possible in both ways, either forward and backward easily as compared to Single Linked List. Following are the import原创 2017-07-21 10:05:11 · 2373 阅读 · 0 评论 -
Datasture-1 Stack--用Java实现
1. 简单介绍 栈stack:是一种实现了后进先出的数据结构,LIFO(last in first out), 典型的方法是push()和pop()压栈和弹栈。 2. 代码实现//Stack.java package com.fqyuan.stack;import java.lang.reflect.Array;public class Stack<T> { private int si原创 2017-07-19 15:34:17 · 265 阅读 · 0 评论 -
Data structure-5 二叉搜索树 BST--Java语言实现
BST简介本文部分内容参考自此处。 Binary Tree : A data structure in which we have nodes containing data and two references to other nodes, one on the left and one on the right. Binary Tree consist of N原创 2017-07-22 13:04:14 · 449 阅读 · 0 评论 -
Data structure-3 单链表LinkedList--Java语言实现
1. 链表特点 One disadvantage of using arrays to store data is that arrays are static structures and therefore cannot be easily extended or reduced to fit the data set. Arrays are also expensive to mainta原创 2017-07-20 20:53:55 · 371 阅读 · 0 评论 -
搜索算法--线性搜索、二分搜索、内插搜索、剪枝搜索
线性搜索 二分搜索 内插搜索 剪枝搜索原创 2017-07-28 20:59:52 · 1790 阅读 · 0 评论 -
Data Structure-7 HashTable 哈希表
1. 哈希表部分理论内容参考自这里。 Hash Table is a data structure which stores data in an associative manner. In a hash table, data is stored in an array format, where each data value has its own unique index value.原创 2017-07-29 12:07:49 · 369 阅读 · 0 评论 -
Data structure-6 红黑树(BlackRedTree)插入操作
1. 红黑树吐槽 在整理之前学过的数据结构知识(主要是应对找工作)时候,动手实现了栈、队列、单链表、双链表、二叉搜索树,上述列举的这些基础的数据结构实现起来还是挺简单的,稍微思考一下即可完成常见的insert/delete/search/traverse操作。 我承认,在红黑树的时候我遇到障碍了,大概花了一天的时间完成了这个版本的红黑树插入操作的代码。后来我反思了一下,之所以这样可能原创 2017-07-26 21:50:20 · 273 阅读 · 0 评论 -
实现最小栈
1. 要求 及思路 实现一个最小栈,主要实现包括以下方法,且满足操作的时间复杂度为O(1): void push(E val): 压入一个元素; E pop():从栈中弹出一个元素; E top():返回栈顶元素; E min():返回栈中最小元素; 思路:这里考虑用2个栈实现,用内存换取效率。 其中一个栈用来存当前容器中的最小值;另一个栈用来存所有元素。 2. Ja原创 2017-08-29 20:02:30 · 784 阅读 · 0 评论