일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- DataFlow
- Kubernest
- 구글클라우드서밋
- 네트워크
- Dataproc
- cloud
- GCP
- go
- 클라우드 자격증
- 머신러닝
- golang
- 구글
- 클라우드
- 쿠버네티스
- 마이크로서비스
- aws
- coursera
- AWS #빅데이터 #분석 #데이터
- 구글 클라우드
- 자격증
- cdk
- 도커
- 구글클라우드플랫폼
- docker
- 구글클라우드
- nnictl
- 코세라
- Associate
- 딥러닝
- Today
- Total
JD의 블로그
3. ADT(Abstract Data Type) 본문
1. What is ADT
Data type
1) Representation of data (How you are storing the data)
2) operations on data (What are the operations that you allow on the data)
Abstract
: hiding internal details. (we need not know internal details - how these operations are performed.)
Without knowing them, we can use them.
When the Object Oriented Programming languages being started to use in Software Development, then using the classes, we can define our own data types, that are Abstract.
2. List ADT
the data that is required for storing lise is, first I needspacefor storing elements.
The second thins is, I need to have some capacity of a list.
The third is, inside that capacity, how many elements already I have in the list, that is length of the list, or size of a list. (the number of it is having)
for representation of this one, I have two options.
1) Array
2) Linked list
Operations on a list
1) add(element), append(element) : I want to add something to the end of a list
+ add(index, element), insert(index, element) : adding an element at a given index (If you want to insert any element at a given index, then you have to shift the elements.)
2) remove(index) : After removing, we have to shift the rest of the elements.
3) Set(index, element), replace(index, element) : changing an element at a given index.
4) get(index) : I want to know the element at a given index
5) Search(key), contains(key) : searching for an element to find its index if it is present in the list.
6) Sort() : to arrange all elements in some order
...
Having the representation of data + the operations = DataType
the concept of ADT , define the data, and operations on data together
and let it be used as data type, by hiding all the internal details!
when any class in C++ which has the data representation and operations together, it defines an ADT.
'-프로그래밍 언어 > 알고리즘&자료구조' 카테고리의 다른 글
5. Matrices[1] - Diagonal Matrix (0) | 2019.09.19 |
---|---|
4. Time and Space complexity (0) | 2019.09.18 |
2. Physical data structure & Logical data structure (0) | 2019.09.18 |
1. Stack vs Heap (0) | 2019.09.18 |
[Algorithm & Data structure] Introduction (0) | 2019.09.16 |