본문 바로가기 메뉴 바로가기

just_HS

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

just_HS

검색하기 폼
  • 분류 전체보기 (247)
    • python (5)
    • golang (83)
    • embedded (25)
    • google cloud platform (3)
    • google colaboratory (4)
    • deep learning (2)
    • blockchain (9)
    • git (12)
    • etc (12)
    • life-health (14)
    • javascript30 (19)
    • development (32)
    • book-movie (27)
  • 방명록

min heap (2)
Golang으로 Min Heap을 구현해보자 - container/heap 패키지 사용

Photo by Markus Spiske on Unsplash 이번에는 container/heap 패키지를 이용해서 구현해보자 "요구사항만 만족해주면 원하는 heap 기능을 제공하겠다." 이렇게 한 줄 요약할 수 있겠다. (Fix, Remove 등의 기능도 있지만 이것은 생략하겠다.) 이전 포스팅한 from the scratch 구현 - https://jusths.tistory.com/215 - https://play.golang.org/p/cjYXpQjPiZY container/heap을 이용한 구현 - https://play.golang.org/p/JwU6aHNGb7k 요구사항과 제공기능 https://golang.org/pkg/container/heap/#Interface 어떠한 타입이건 sort...

golang 2021. 5. 4. 11:23
Golang으로 Min Heap을 구현해보자

Photo by Markus Spiske on Unsplash LeetCode 문제를 풀다가 min heap이 필요한 문제를 만난김에, Go는 쉽게 쓸 수 있는 패키지는 제공하지 않기에 (오히려 그 덕분에) min heap을 들여다보고 공부해보게 되었다. (참고: LeetCode problem: https://leetcode.com/contest/weekly-contest-237/problems/single-threaded-cpu/ ) Min Heap이란 무엇인가? 이진 트리인데 parent는 아래의 child 노드들보다 작은 값을 가진다. 실제 구현은 슬라이스의 형태이다. < 이미지 출처: https://www.wikiwand.com/en/Min-max_heap > 아래 이미지는 Max Heap이지만,..

golang 2021. 5. 4. 09:35
이전 1 다음
이전 다음
반응형
공지사항
최근에 올라온 글
  • 코로나 신속 항원 검사와⋯
  • QCY-HT01을 Windows 10 PC⋯
  • 2021년 독서 후기
  • Golang: 양자 컴퓨터 이후⋯
최근에 달린 댓글
  • 감사합니다.
  • zchrc오타났어요 zshrc에요
  • good 완벽합니다
  • 헛 바로 찾아주시다니.. 정말⋯
Total
327,561
Today
27
Yesterday
136
링크
TAG
  • 클린 애자일
  • Pocket Edition
  • go
  • Team of Rivals: The Political Genius of Abraham Lincoln
  • 명상
  • golang
  • Nike Run Club
  • 하드씽
  • 자아
  • agile
  • min heap
  • AES
  • 독서후기
  • websocket
  • gorilla/websocket
  • post quantum
  • additional data
  • solid
  • sidh
  • post-quantum cryptographic algorithm
  • Google
  • SIKE
  • powershell
  • gcm
  • Gin
  • framework
  • Garmin Connect
  • Handshake
  • heap
  • 권력의 조건
more
«   2022/05   »
일 월 화 수 목 금 토
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        
글 보관함
  • 2022/03 (1)
  • 2022/01 (1)
  • 2021/12 (8)
  • 2021/11 (6)

Blog is powered by Tistory / Designed by Tistory