[Data Structure/자료구조] Data Structures and Types

sbj·2023년 11월 26일
0

Data Structures and Types

Linear Data Structure

The data is stored in linear data structures sequentially. These are rudimentary structures since the elements are stored one after the other without applying any mathematical operations.
데이터는 Linear 데이터 구조에 순차적으로 저장된다. 수학연산 없이 요소를 차례대로 저장하므로 기본적인 구조이다.

Linear data structures are −

  • Arrays (배열)
  • Linked Lists (연결리스트)
  • Stacks (스택)
  • Queues (큐)

Static Linear Data Structures (정적 데이터 구조)

In Static Linear Data Structures, the memory allocation is not scalable. Once the entire memory is used, no more space can be retrieved to store more data.

The best example for static linear data structures is an array.

정적 데이터 구조에서는, 메모리 할당 확장이 불가능하다. 전체 메모리가 한 번 사용되면, 데이터를 저장하기 위해 공간을 검색할 수 없다.
정적 데이터 구조의 가장 좋은 예: 배열


Dynamic Linear Data Structures (동적 데이터 구조)

In Dynamic linear data structures, the memory allocation can be done dynamically when required. These data structures are efficient considering the space complexity of the program.

Few examples of dynamic linear data structures include: linked lists, stacks and queues.

동적 데이터 구조에서는, 자유롭게 메모리를 할당할 수 있다. 동적 데이터 구조는 프로그램의 the space complexity(공간복잡도)를 고려하면 효율적임.
동적 데이터 구조의 대표적 예: 연결 리스트, 스택, 큐


Non-Linear Data Structure(비선형구조)

Non-Linear data structures store the data in the form of a hierarchy. Therefore, in contrast to the linear data structures, the data can be found in multiple levels and are difficult to traverse through.

비선형구조는 데이터를 계층적으로 저장한다. 그래서 선형구조와 다르게 데이터를 다양한 계층에서 찾을 수 있고 탐색하기 어렵다.

However, they are designed to overcome the issues and limitations of linear data structures. For instance, the main disadvantage of linear data structures is the memory allocation. Since the data is allocated sequentially in linear data structures, each element in these data structures uses one whole memory block.

그러나, 비선형구조는 선형 구조의 문제와 한계를 극복하도록 설계되었다. 예를 들면, 선형구조의 가장 큰 문제점은 메모리 할당이다.
---> 왜? 선형 구조는 데이터가 순차적으로 할당되어 있으니까, 데이터 구조의 각 요소들은 전체 메모리 블록을 사용한다.

However, if the data uses less memory than the assigned block can hold, the extra memory space in the block is wasted. Therefore, non-linear data structures are introduced. They decrease the space complexity and use the memory optimally.

그러나, 데이터가 할당된 메모리 블록이 사용할 수 있는 것 보다 적은 메모리를 사용하는 경우, 추가 메모리 공간이 낭비된다.

그래서 비선형데이터구조가 도입되었다. → 공간 복잡도를 감소시키고, 메모리를 최적화해서 사용할 수 있다.

Few types of non-linear data structures are −

  • Graphs (그래프)
  • Trees (트리)
  • Tries (트라이)
  • Maps (맵)

Please feel free to point out if there are any mistakes or errors in my judgement. 🙇🏻‍♀️
틀린 부분이 있거나, 제 판단에 오류가 있다면 마음껏 지적 부탁드립니다.

profile
Strong men believe in cause and effect.

0개의 댓글