Skip to content

Latest commit

 

History

History
74 lines (52 loc) · 1.99 KB

File metadata and controls

74 lines (52 loc) · 1.99 KB

Data Structures Introduction

Contents

  • Binary Search Trees
  • Queues
  • Singly Linked Lists
  • Undirected Unweighted Graphs
  • Binary Heaps
  • Directed Graphs
  • Hash Tables
  • Doubly Linked Lists
  • Stacks

데이터 구조란 무엇인가?

집합, 데이터 간의 관계, 또는 데이터에 적용할 수 있는 함수와 연산들을 자료 구조라고 합니다.

왜 이렇게 종류가 많은가??

서로 다른 자료 구조는 각자의 강점이 있습니다. 몇몇 자료 구조는 전문화 되어 있지만 다른 몇몇 자료 구조들은 아주 흔히 쓰입니다.

왜 중요한가???

개발자로써 데이터 구조를 많이 다뤄야 합니다. 이미 다양한 데이터 구조를 사용하고 있습니다. 데이터를 효율적으로 다루기 위해서는 데이터 구조를 아는게 좋습니다.

ES2015 Class Syntax

자료 구조를 보기 전에 ES2015 Class Syntax에 대해 간단히 알아봅시다.

클래스란 무엇인가?

미리 정의한 프로퍼티와 메소드를 이용해서 객체를 만들기 위한 청사진입니다.

클래스를 이용해서 자료 구조를 만들어봅시다.

the Syntax

class Student {
    constructor(firstName, lastName, year) {
		this.firstName = firstName;
        this.lastName = lastName;
        this.grade = year;
    }
}

let firstStudent = new Student("Colt", "Steele", 2);
let secondStudent = enw Student('Blue', "Steele", 4)

새로운 객체를 만들기 위해서는 new라는 키워드를 사용해야 합니다.

Instance Methods

class Student {
    constructor(firstName, lastName, year) {
		this.firstName = firstName;
        this.lastName = lastName;
        this.grade = year;
    }
    fullName() {
		return `Your full name is ${this.firstName} ${this.lastName}`;
    }
}

let firstStudent = new Student("Colt", "Steele", 2);
let secondStudent = new Student('Blue', "Steele", 4)

firstStudent.fullName() // Your full name is Colt Steele

Class Methods