[CrashCourse CS] #14 Data Structure

Steve·2021년 4월 21일
0

Data Structure

  • How data is stored in the memory.
  • Sturcture data to make it organized, allowing data to be easily retrieved and read.

Array

  • Array is delcared as sequencial spaces in memory.
  • Every language has built-in sort function for arrays.
  • Array of arrays = matrix. It is also stored in memory sequencially.
  • Array gets created at a fixed size that can't be enlarged to add more items.
  • Arrays must be stored in order in memory, making it hard to add a new item to the middle.

String

String - Array of characters.

  • Has null character at the end, denotes the end of a string. It tells the string functions when to stop.

Struct

  • Store several pieces of data.

Linked List

  • Flexible data structure that can store many nodes.
  • It can be dynamically extended or shortened, and easily be reordered, trimmed, split, reversed, so on.
  • Each node has a pointer that has the address of next node in the list.
  • Node might be spaced apart, b/c they were created at different times.

Queue

  • First-in, First-out (FIFO).

Stack

  • Last-in, First-out (LIFO).
  • Data push, data pull.

Tree

  • Has two pointers in nodes.
  • Root, parent, child, leaf nodes.

Graph

  • For data that links arbitarily.

More

  • red-black trees, heaps, ...

Vocabulary

  • versatile - have many different skills or purposes.
  • enlarge - becomes bigger.
  • nifty - 솜씨 좋은, 훌륭한
  • arbitary - not based on any principle, plan, or system (임의적인, 독단적인, 제멋대로인)
  • whirlwind - 회오리바람

Thoughts

  • 자료구조는 사실 자료구조 자체만으로는 지루하다. 게임을 만들면서 자료구조를 활용해야 재밌다.
  • 다음은 Alan Turing 에 관한 이야기다. 영화로 한번 본 적이 있는 만큼 재미있을 것 같다.
profile
게임과 프론트엔드에 관심이 많습니다.

0개의 댓글