[python] bisect : 이진 탐색, Lower Bound, Upper Bound

markyang92·2021년 11월 9일
0

python

목록 보기
37/43
post-thumbnail

biscet 모듈


  • biscetbinary search를 지원한다.
  • 정렬된 리스트 'a' 에 데이터 x
    • bisect_left(a,x) : -> int 가장 왼쪽 인덱스 반환
      • lower bound 라고 생각하면 될 듯
    • bisect_right(a,x) : -> int 가장 오른쪽 인덱스 반환
      • upper bound라고 생각하면 될 듯


profile
pllpokko@alumni.kaist.ac.kr

0개의 댓글