Sandbox

  • 홈
  • 태그
  • 방명록

LeetCode 21

[LeetCode] Two Sum

Problem Solution Could use nested for-loops but that will end up with O(n^2) complexity. Arrays have constant complexity when accessing a known index. However arrays can have up to O(n) complexity when searching while hashmap has near constant complexity. In order to improve the speed, make a hashmap by mapping each element in nums to its index number. When iterating through the array, get the c..

CODE/Algorithms & Data Structures 2021.10.01
이전
1 2 3
다음
더보기
프로필사진

Sandbox

  • 분류 전체보기 (48)
    • CODE (2)
      • Algorithms & Data Structure.. (43)
      • React (0)
    • READ (3)

Tag

dynamic programming, inorder traversal, binary search tree, Merge Sort, Binary Tree, LinkedList, Binary Search, LeetCode, depth first search, string, Implementation, java, python3, Linked List, hackerrank, Coderust, algorithm, array, level order traversal, preorder traversal,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/09   »
일 월 화 수 목 금 토
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

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바