티스토리 뷰
Algorithm & Data structure
What are Algorithms and Data structures?
The data structure is those different ways of storing data on your program.
e.g. Array, List, Stack, Queue, Tree, Hash etc,
The algorithm is operations on different data structures + sets of instructions for executing them.
e.g. Sort, Search, Max, Min etc,
Let's see the image to get a concrete example.
We can see alphabet A to E and each path connecting one character to another one. when it comes to algorithms, it is about how to solve a problem. Let's say we need a shorted path A to E using the picture.
First, you need to check all the alphabet we have on the picture
Second, you also need the paths connecting each character
Third, the distance of each path is required to be checked to measure.
Fourth, try the path based on previous steps
Last, find the shortest path.
this step is an example of what an algorithm is.
But an algorithm would be somewhat different if you use a different type of data structure.
Data structure is a data organization and storage format that enables efficient access and modification.
For example, alphabet A has paths to A to C and A to D. let's make a table for that.
A | A to C, A to D |
B | B to C, B to E |
C | C toA, C to B, C to D, C to E |
D | D to A, D to C, D to E |
E | E to D, E to C, E to B |
And we can have another type of table.
A to C |
A to D |
B to C |
B to E |
C to D |
C to E |
D to E |
two tables have a different data structure. So these are the example of data structure.
The first table looks like Array or List and the Second looks like HashTable or HashMap data structure.
Reference
https://en.wikipedia.org/wiki/Data_structure
https://www.youtube.com/watch?v=bum_19
https://en.wikipedia.org/wiki/Algorithmloj9A&list=PLBZBJbE_rGRV8D7XZ08LK6z-4zPoWzu5H
'Programming' 카테고리의 다른 글
Static URL & Dynamic URL (0) | 2019.02.28 |
---|---|
Http Response & Http Status Code (0) | 2019.02.27 |
Web app vs Mobile app (0) | 2019.01.20 |
difference between Framework and Library (0) | 2019.01.11 |
RestAPI (0) | 2019.01.10 |
- Total
- Today
- Yesterday
- easy algorithm
- math.abs
- ... in Javascript
- hackerrank solution
- java
- 프로그래머스 알고리즘
- hackerrank javascript solution
- algorithm
- equals()
- repeat()
- Javascript Algorithm
- rest parameter
- C++
- Object type casting
- 프로그래머스
- HashMap
- 알고리즘
- hackerrank javascript
- javascript
- 프로그래머스 알고리즘문제
- substring()
- compareTo()
- spring boot application
- code refactoring
- math.max
- Collection Framework
- hackerrank
- string class in java
- HackerRank Algorithm
- easy javascript algorithm
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |