HappyTomatoLife

  • 홈
  • 태그
  • 방명록

binary search 2

자료구조 | Binary Search | Search

Binary Search def binary(lst, item, left, right): pass def binary(lst, item, left, right): while True: if left > right: break mid = (left + right) // 2 if lst[mid] == item: return mid elif lst[mid] > item: right = mid - 1 else: left = mid + 1 return -1 lst = [1,2,3,34,55,67,89,100] print(binary(lst, 100, 0, len(lst)-1))

Computer Science/자료구조 2021.12.29

자료구조 7강 | Search 탐색 (순차, 이진, 해시, 보간) | 숙명여대 학점교류

숙명여대 학점교류로 듣는 자료구조 day 6. 2021.12.29. 수요일 Search Sequential search binary search interpolation search hashing search Sequential search a search key is searched sequentially from the first item of a list with unordered items average # of comparisons : (n+1)/2 def seqsearch(num, item, n): for i in range(n): if item == num[i]: return i return -1 레코드에서 아무런 가공을 하지 않고 탐색을 시작한다. 계속 반복적으로 + 순서대로 비교한다. b..

Computer Science/자료구조 2021.12.29
이전
1
다음
더보기
프로필사진

HappyTomatoLife

기록하는 토마토

  • 분류 전체보기
    • About
    • Data Science
      • AI
      • NLP
      • Computer Vision
      • Data Mining
      • Data Engineering
    • Computer Science
      • 알고리즘
      • 자료구조
      • 프로그래밍언어
      • 컴퓨터구조
      • C
      • C++
      • C#
      • Java
      • FrontEnd
      • BackEnd
      • DevOps
      • Database
      • 논리설계
    • Math
      • 선형대수학
      • 이산수학
    • Educational Technology
      • Learning Analytics
    • English
    • Certificate
      • 컴퓨터활용능력 1급
      • SQLD
    • Life

Tag

SQL, REACT, 교육상담, DS, linked Queue, JavaScript, 반복문, 조건문, 자료구조, Expression evaluation, 함수형 언어, react.js, maze problem, Doubly Linked List, singly linked list, Deque, OCaml, binary search, linked stack, linear DS,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/07   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

  • Github
  • LinkedIn

티스토리툴바