Wecode 05/11/2020

Michael Minchang Kim·2020년 5월 12일
0

wecode

목록 보기
15/22

Data Structure

1. What is Data Structure?

Data structure is a way to store or organize data so that it is easier to access.
There are multiple types of data sturcture but no one type will be applicable in all situations.
It is important to understand the concept of each structure and choose the most appropriate type for each situation.

2. Why use Data Structure?

So why do people use data structure? We'll use an analogy for clarification. What kind of bag would be best fitting for carrying make-up around? A carrier? A backpack? A suitecase? A pouch? Of course the answer would be a pouch. Using an entire suitcase for carrying around makeup would be exrtemly inefficient. Data structure works in a similar way. By using data structure, you can organize data into containers that fit the situation.

3. Types of Data Structure.

Data structure can be sorted into two big categories: Primitive and Non-Primitive.

Primitive data structures(단순구조) are the basic data types that are used in programming such as integers, floats, strings, and boolean. They are the building blocks of more complex data structures and serve the use of storing data.

Non-Primitive data structures(비단순 구조) not only simply store data but also have structure that allows the programmer to form data in such a way that fits the purpose of the code.
Within the category of Non-primitive data types are two more sub categories of Linear Data Structure(선형구조) and Non-Linear Data Structure(비선형 구조)

Linear data structures are structures in which there is only one following element for each element (ex. Lists, Stacks, Queues)

Non-Linear data structures are structure in which one elements can have multiple sub-elements connected to it (ex. Graphs, Trees)

Array

Arrays are the most basic and most used data structure. If you have coded before there is a very high chance that you have seen an array.

1. Characteristics of Arrays

a.  Arrays store data in the order they are inserted. Each element in turn can be accessed through indexing since they are indexed in the order they are stored.

b.  Arrays also allow for a connection between the stored variable. Even when indexing is not neccessary, arrays can be a good choice.

c.  Arrays are mutable. The elements inside can be replaced and removed.

d.  Multiple elements can have the same value.

e.  Multi-dimentional Arrays are possible. Arrays can have arrays as elements.

2. The Inner Structure of Arrays

profile
Soon to be the world's Best programmer ;)

0개의 댓글