일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- coursera
- 구글
- AWS #빅데이터 #분석 #데이터
- 구글클라우드플랫폼
- 네트워크
- 딥러닝
- nnictl
- 마이크로서비스
- 구글클라우드서밋
- golang
- 머신러닝
- 코세라
- 구글클라우드
- Kubernest
- 쿠버네티스
- GCP
- 클라우드
- docker
- DataFlow
- Associate
- cloud
- 자격증
- go
- 도커
- 구글 클라우드
- 클라우드 자격증
- Dataproc
- cdk
- aws
- Today
- Total
JD의 블로그
2. Physical data structure & Logical data structure 본문
1. Physical
: for storing the data
[1] Array
A collection of continous memory locations, all these locations are side by side.
This array will have fixed size, once it is created of some size, then that size cannot be increased or decreased.
The size of array is fixed.
An array can be created either inside stack or heap.
When should I use it?
When you are sure, what is the maximum number of elements that you are going to sotre. (when you know length of the list)
[2] Linked List
This is a complete dynamic data structure, and it is a collection of nodes where each node contains data, and is linked to the next node. The length of this list can grow and reduce, dynamically. So, It is having variable length.
You can go on adding more and more nodes and add more elements.
The linked list is always created in heap.
Head may be a pointer, that is pointing the list, so the head pointer may be inside the stack.
When should I use it?
if the size of the list is not known.
We can have more physical data structures, by taking the combination of these.
The reason why these are called "physical" is these data structure decides or defines how the memory is organized, how the memory is allocated.
2. Logical
: How you will be performing insertion and deletion?
These data structures are actually used in applications and algorithms.
To implement these data structures, we either use array or linked list.
Linear data structures
[1] Stack (LIFO - Last in First out)
[2] Queue (FIFO - First in First out)
Non-linear data structures
[3] Tree (collection of nodes and the links between the nodes.)
[4] Graph
Tabular data structure
[5] Hash Table
'-프로그래밍 언어 > 알고리즘&자료구조' 카테고리의 다른 글
5. Matrices[1] - Diagonal Matrix (0) | 2019.09.19 |
---|---|
4. Time and Space complexity (0) | 2019.09.18 |
3. ADT(Abstract Data Type) (0) | 2019.09.18 |
1. Stack vs Heap (0) | 2019.09.18 |
[Algorithm & Data structure] Introduction (0) | 2019.09.16 |