본문 바로가기

부부의 코딩 성장 일기

검색하기
부부의 코딩 성장 일기
프로필사진 펩시_콜라

  • 분류 전체보기 (147)
    • Algorithm (135)
      • LeetCode (135)
    • Python (6)
      • Fundamentals (5)
      • Libraries (1)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2024/03   »
일 월 화 수 목 금 토
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
Tags
  • string
  • DP
  • 재귀
  • HashTable
  • two pointers
  • dfs
  • math
  • binary search
  • Binary
  • leetcode
  • 미디움
  • 이진트리
  • Python
  • list
  • backtracking
  • binary tree
  • Depth-first Search
  • tree
  • recursive
  • 문자열
  • matrix
  • hash table
  • sorting
  • Array
  • 리트코드
  • 쉬움
  • Medium
  • 중간
  • linked list
  • easy
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록2024/03/29 (1)

부부의 코딩 성장 일기

LeetCode 143(Reorder List, Python)

1. 문제 링크 https://leetcode.com/problems/reorder-list/ 2. 문제 설명 linked list의 head가 주어졌을 때, 해당 list를 아래처럼 표현할 수 있다. L0 → L1 → ... → Ln-1 → Ln 이 때, 아래의 형태가 되도록 list를 reorder해라. L0 → Ln → L1 → Ln-1 → L2 → Ln-2 → ... 여기서 node의 value자체를 수정하는 것이 아니라, node의 연결관계를 바꿔야 한다. 예시1) head가 [1,2,3,4]로 1→2→3→4의 연결관계를 가지고 있다면, 1→4→2→3으로 변경할 수 있다. output = [1,4,2,3] 예시2) head가 [1,2,3,4,5]로 1→2→3→4→5의 연결관계를 가지고 있다면, ..

Algorithm/LeetCode 2024. 3. 29. 19:00
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바