목록2023/11/06 (2)
넘치게 채우기
객체 지향 프로그래밍. OOP(Object-Oriented-Programming)에서 이 OO의 본질을 설명하기 위해서 세 가지 주문에 기대곤 한다. 캡슐화(encapsulation) 상속(inheritance) 다형성(polymorphism) OO언어는 최소한 이 세가지를 충족해야한다고 한다. 캡슐화? OO를 정의하는 요소 중 하나로 캡슐화를 언급하는 이유는 데이터와 함수를 쉽고 효과적으로 캡슐화하는 방법을 OO언어가 제공하기 때문이다. 그리고 이를 통해 데이터와 함수가 응집력 있게 구성된 집단을 서로 구분 짓는 선을 그을 수 있다. 구분선 바깥에서 데이터는 은닉되고, 일부 함수만이 외부에 노출된다. 이 개념들이 실제 OO 언어에서는 private 멤버 데이터와 public 멤버 함수로 표현된다. 이러..
https://leetcode.com/problems/seat-reservation-manager/description/ Seat Reservation Manager - LeetCode Can you solve this real interview question? Seat Reservation Manager - Design a system that manages the reservation state of n seats that are numbered from 1 to n. Implement the SeatManager class: * SeatManager(int n) Initializes a SeatManager object that leetcode.com leetcode - Seat Reservati..