Skip to content

Test program for interview at NTS (NHN Technology Service)

License

Notifications You must be signed in to change notification settings

chawoo-jeon/RecordMaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RecordMaker

Test program for interview at NTS (NHN Technology Service)

프로그램 설명

중복없는 숫자를 랜덤하게 작성해야 한다. 랜덤하게 뽑은 숫자의 중복여부는 2가지 방법으로 구현가능 하다.

  1. 시간 우선 (priority in time)
  • 빠른 시간내에 (주로 다항 시간) 중복 여부를 알 수 있음.
  • 추가적인 공간 영역을 활용하는 방법
  1. 공간 우선 (priority in space)
  • 추가적인 공간 영역을 필요로 하지 않음.
  • 저장된 Record의 정렬 상태나, 검색 알고리즘에 따라 시간이 달라짐.

이번 면접 과제에서는 0~9999의 범위의 숫자를 랜덤하게 뽑는다. 총 3번을 반복하므로 저장할 Record의 크기가 적다. (다른말로, 숫자를 뽑았을 때, 중복될 확률이 낮다.)

  • N번째 숫자를 뽑을 때 중복될 확률 = (N-1) / (9999 - 0 + 1)

만약 반복 횟수가 증가할 것을 대비해

  1. 시간 우선 방법과 2. 공간 우선 방법을 선택하거나 혼합하여 사용할 수 있도록 구성하였다.

About

Test program for interview at NTS (NHN Technology Service)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages