Overview of Data Structures


Data Structure

 

 

 

Advantages

 

 

 

 

Disadvantages

 

 

 

 

 

 

 

 

Array

 

 

 

Quick insertion, very fast access if index known

 

 

 

 

Slow search, slow deletion, fixed size.

 

 

 

 

Ordered array

 

 

 

Quicker search than unsorted array.

 

 

 

 

Slow insertion and deletion, fixed size.

 

 

 

 

Stack

 

 

 

Provides last-in, first-out access.

 

 

 

 

Slow access to other items.

 

 

 

 

Queue

 

 

 

Provides first-in, first-out access.

 

 

 

 

Slow access to other items.

 

 

 

 

Linked list

 

 

 

Quick insertion, quick deletion.

 

 

 

 

Slow search.

 

 

 

 

Binary tree

 

 

 

Quick search, insertion, deletion (if tree remains balanced).

 

 

 

 

Deletion algorithm is complex.

 

 

 

 

Red-black tree

 

 

 

Quick search, insertion, deletion. Tree always balanced.

 

 

 

 

Complex.

 

 

 

 

2-3-4 tree

 

 

 

Quick search, insertion, deletion. Tree always balanced. Similar trees good for disk storage.

 

 

 

 

Complex.

 

 

 

 

Hash table

 

 

 

Very fast access if key known. Fast insertion.

 

 

 

 

Slow deletion, access slow if key not known, inefficient memory usage.

 

 

 

 

Heap

 

 

 

Fast insertion, deletion,

 

 

 

 

Slow access to other items.access to largest item.

 

 

 

 

Graph

 

 

 

Models real-world situations.

 

 

 

 

Some algorithms are slow and complex.
时间: 2024-11-08 09:26:15

Overview of Data Structures的相关文章

The Model represents your data structures.

w模型代表数据结构. https://www.codeigniter.com/userguide3/overview/mvc.html http://codeigniter.org.cn/user_guide/overview/mvc.html Model-View-Controller CodeIgniter is based on the Model-View-Controller development pattern. MVC is a software approach that se

Data Structures and Algorithms with JavaScript

Book Description As an experienced JavaScript developer moving to server-side programming, you need to implement classic data structures and algorithms associated with conventional object-oriented languages like C# and Java. This practical guide show

Manipulating Data Structures

Computer Science An Overview _J. Glenn Brookshear _11th Edition We have seen that the way data structures are actually stored in a computer's memory is not the same as the conceptual structure envisioned by the user. A two-dimensional homogeneous arr

2017 UESTC Training for Data Structures

2017 UESTC Training for Data Structures A    水,找区间极差,RMQ怼上去. #include<bits/stdc++.h> using namespace std; #pragma comment(linker, "/STACK:102400000,102400000") #define rep(i,a,b) for (int i=a;i<=b;i++) #define per(i,b,a) for (int i=b;i&

【DataStructure】Linked Data Structures

Arrayss work well for unordered sequences, and even for ordered squences if they don't change much. But if you want to maintain an ordered list that allows quick insertions and deletions, you should use a linked data structure. so inserting an elemen

2014 UESTC Training for Data Structures H - Cookies Test

H - Cookies Test Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Submit Status As chief programmer at a cookie production plant you have many responsibilities, one of them being that the cookies produced and packag

2014 UESTC Training for Data Structures K - 方师傅与栈

K - 方师傅与栈 Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Submit Status 方师傅有一个1?N的排列,排列的顺序是固定的,他想要把这个排列重新排列成他喜欢的顺序. 于是他买了一个栈,他会按顺序将排列扔进栈内,在某些时刻将栈顶元素取出,这样出栈后的排列就可以重新排序啦. 例如,原序列是1,2,他先将1入栈,再将2入栈,然后将2出栈,最后将1出栈,那么新序列就变

2014 UESTC Training for Data Structures J - 方师傅的01串

J - 方师傅的01串 Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Submit Status 方师傅过生日啦,于是蟹毛买了N个01串,想送给方师傅. 但是蟹毛觉得这些01串不够美,于是他想从中选出一些送给方师傅. 蟹毛对于p个01串的美值定义为: 这些01串的最长公共前缀的长度×p 所以蟹毛想从N个01串中选出一些,使得这些01串的美值最高. 请告诉蟹毛最好的美值是多少.

2014 UESTC Training for Data Structures C - 东风不与周郎便

C - 东风不与周郎便 Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Submit Status "揽二乔于东南兮,乐朝夕之与共" 一首铜雀台赋,将愤怒与恐惧散播在了孙吴大军之中. 对抗曹军,万事俱备,只欠东风. 现在已经找到n个风眼,这些风眼的东风有强有弱,诸葛亮说他每次祈风都能够将一段风眼的东风增强,但需人去帮他布阵.同时他需要时刻掌控风眼的状况,以确定下一步的