본문 바로가기

shine's dev log

검색하기
shine's dev log
프로필사진 dong1

  • 분류 전체보기 (117)
    • 프로그래밍, 알고리즘 (11)
    • 운영체제 (31)
    • 컴퓨터 네트워크 (32)
    • 보안 (20)
    • 머신러닝 (7)
    • 논문 (11)
    • 기타 (4)
Guestbook
Link
  • ME
  • GitHub
Recent Posts
Recent Comments
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록max subarray (1)

shine's dev log

[알고리즘] Maximum-subarray 구하기 (Divide-and-conquer 활용)

1. Maximum-subarray 코드 def FindMaximumSubarray(A, low, high): if high < low: return 0, 0, 0 if high == low: return low, high, A[low] else: mid = (low + high) // 2 (left_low, left_high, left_sum) = FindMaximumSubarray(A, low, mid - 1) (right_low, right_high, right_sum) = FindMaximumSubarray(A, mid + 1, high) (cross_low, cross_high, cross_sum) = FindMaxCrossingSubarray(A, low, mid, high) if left_s..

프로그래밍, 알고리즘 2021. 10. 23. 02:17
이전 Prev 1 Next 다음

Blog is powered by AXZ / Designed by Tistory

티스토리툴바