학습 본문으로 건너뛰기
VAIRODE
tree와 heap29번째 작은 수업
오늘은 질문 하나만 해결해요29 / 72

따라 해보기 · 직접 바꿔보기

complete binary shape와 parent/child array index

오늘의 질문

binary heap은 level-order로 빈틈없이 채운 complete shape이며 0-based parent·left·right index 공식과 array length boundary를 함께 사용한다. 이를 생략하면 1-based와 0-based 공식을 섞거나 right child가 array 밖인데도 읽는다.에서도 작은 그림은 맞아 보일 수 있지만 skew·delete·rotation·tie·metadata 경계에서 재현 가능한 판단은 남지 않습니다.

아직 답을 몰라도 괜찮아요. 아래 작은 예시를 보고 먼저 예상해 보세요.

01 · 같이 연습해요

작은 문제부터 하나씩 직접 풀어봐요

먼저 예상하고, 한 단계씩 확인하고, 막힌 곳을 고쳐 봐요. 도움을 열어도 괜찮아요. 도움을 본 문제는 나중에 모양을 바꿔 다시 풀어보면 됩니다.

연습에서 작성 중인 답0 / 8
  1. 01

    찾아보기 · 기초

    th29 recognize · complete binary shape와 parent/child array index: complete binary tree·zero-based index·last internal node 단서에서 “binary heap은 level-order로 빈틈없이 채운 complete shape이며 0-based parent·left·right index 공식과 array length boundary를 함께 사용한다.”을 만족하는 topology·operation·claim을 고른다.

    이 문제는 주어진 내용과 정답 기준을 더 만드는 중이에요. 지금 적은 답은 연습 메모로만 저장돼요.

    정답 대신 4단계 힌트 보기
    1. 관찰

      1-based와 0-based 공식을 섞거나 right child가 array 밖인데도 읽는다. 직전까지 참이었던 root→node path와 처음 달라진 edge·index·metadata·result를 찾으세요.

    2. 개념

      complete binary tree·zero-based index·last internal node를 ADT·topology·source-level로 나눠 적으세요.

    3. 다음 도움

      내 생각을 먼저 적고 ‘내 답과 맞춰 볼 기준 보기’을 누르면, 풀 순서와 더 자세한 도움을 열어 드려요.

    정답과 비교
  2. 02

    먼저 생각하기 · 기초

    th29 predict · complete binary shape와 parent/child array index: “1-based와 0-based 공식을 섞거나 right child가 array 밖인데도 읽는다.” 조건에서 방문 순서·link/index·height/priority·반환값을 실행 전에 봉인한다.

    이 문제는 주어진 내용과 정답 기준을 더 만드는 중이에요. 지금 적은 답은 연습 메모로만 저장돼요.

    정답 대신 4단계 힌트 보기
    1. 관찰

      1-based와 0-based 공식을 섞거나 right child가 array 밖인데도 읽는다. 직전까지 참이었던 root→node path와 처음 달라진 edge·index·metadata·result를 찾으세요.

    2. 개념

      complete binary tree·zero-based index·last internal node를 ADT·topology·source-level로 나눠 적으세요.

    3. 다음 도움

      내 생각을 먼저 적고 ‘내 답과 맞춰 볼 기준 보기’을 누르면, 풀 순서와 더 자세한 도움을 열어 드려요.

    움직임과 비교
  3. 03

    순서 따라가기 · 익힌 것을 써보기

    th29 trace · complete binary shape와 parent/child array index: root/frontier → comparison → edge/index mutation → invariant → result 순서로 tree node↔array index·parent/children·last internal node mapping 표를 완성한다.

    이 문제는 주어진 내용과 정답 기준을 더 만드는 중이에요. 지금 적은 답은 연습 메모로만 저장돼요.

    정답 대신 4단계 힌트 보기
    1. 관찰

      1-based와 0-based 공식을 섞거나 right child가 array 밖인데도 읽는다. 직전까지 참이었던 root→node path와 처음 달라진 edge·index·metadata·result를 찾으세요.

    2. 개념

      complete binary tree·zero-based index·last internal node를 ADT·topology·source-level로 나눠 적으세요.

    3. 다음 도움

      내 생각을 먼저 적고 ‘내 답과 맞춰 볼 기준 보기’을 누르면, 풀 순서와 더 자세한 도움을 열어 드려요.

    움직임과 비교
  4. 04

    내 말로 설명하기 · 익힌 것을 써보기

    th29 explain · complete binary shape와 parent/child array index: binary heap은 level-order로 빈틈없이 채운 complete shape이며 0-based parent·left·right index 공식과 array length boundary를 함께 사용한다.이 필요한 이유와 tree node↔array index·parent/children·last internal node mapping 표가 보장하지 못하는 runtime·concurrency·competition 범위를 설명한다.

    이 문제는 주어진 내용과 정답 기준을 더 만드는 중이에요. 지금 적은 답은 연습 메모로만 저장돼요.

    정답 대신 4단계 힌트 보기
    1. 관찰

      1-based와 0-based 공식을 섞거나 right child가 array 밖인데도 읽는다. 직전까지 참이었던 root→node path와 처음 달라진 edge·index·metadata·result를 찾으세요.

    2. 개념

      complete binary tree·zero-based index·last internal node를 ADT·topology·source-level로 나눠 적으세요.

    3. 다음 도움

      내 생각을 먼저 적고 ‘내 답과 맞춰 볼 기준 보기’을 누르면, 풀 순서와 더 자세한 도움을 열어 드려요.

    설명 기준과 비교
  5. 05

    빈칸 채우기 · 익힌 것을 써보기

    th29 complete · complete binary shape와 parent/child array index: 누락된 base case·child edge·rotation·sift·metadata 칸을 채워 “n=0·1·2·7 heap의 모든 valid parent-child edge를 계산한다.”을 완성한다.

    이 문제는 주어진 내용과 정답 기준을 더 만드는 중이에요. 지금 적은 답은 연습 메모로만 저장돼요.

    정답 대신 4단계 힌트 보기
    1. 관찰

      1-based와 0-based 공식을 섞거나 right child가 array 밖인데도 읽는다. 직전까지 참이었던 root→node path와 처음 달라진 edge·index·metadata·result를 찾으세요.

    2. 개념

      complete binary tree·zero-based index·last internal node를 ADT·topology·source-level로 나눠 적으세요.

    3. 다음 도움

      내 생각을 먼저 적고 ‘내 답과 맞춰 볼 기준 보기’을 누르면, 풀 순서와 더 자세한 도움을 열어 드려요.

    답과 설명 함께 비교
  6. 06

    틀린 곳 고치기 · 익힌 것을 써보기

    th29 debug · complete binary shape와 parent/child array index: AI가 만든 구현에 “1-based와 0-based 공식을 섞거나 right child가 array 밖인데도 읽는다.”를 주입하고 최초 잘못된 structure state transition만 수정한다.

    이 문제는 주어진 내용과 정답 기준을 더 만드는 중이에요. 지금 적은 답은 연습 메모로만 저장돼요.

    정답 대신 4단계 힌트 보기
    1. 관찰

      1-based와 0-based 공식을 섞거나 right child가 array 밖인데도 읽는다. 직전까지 참이었던 root→node path와 처음 달라진 edge·index·metadata·result를 찾으세요.

    2. 개념

      complete binary tree·zero-based index·last internal node를 ADT·topology·source-level로 나눠 적으세요.

    3. 다음 도움

      내 생각을 먼저 적고 ‘내 답과 맞춰 볼 기준 보기’을 누르면, 풀 순서와 더 자세한 도움을 열어 드려요.

    답과 설명 함께 비교
  7. 07

    직접 만들기 · 새 문제

    th29 implement · complete binary shape와 parent/child array index: n=0·1·2·7 heap의 모든 valid parent-child edge를 계산한다.을 frozen synthetic node/workload에 적용해 tree node↔array index·parent/children·last internal node mapping 표를 생성한다.

    이 문제는 주어진 내용과 정답 기준을 더 만드는 중이에요. 지금 적은 답은 연습 메모로만 저장돼요.

    정답 대신 4단계 힌트 보기
    1. 관찰

      1-based와 0-based 공식을 섞거나 right child가 array 밖인데도 읽는다. 직전까지 참이었던 root→node path와 처음 달라진 edge·index·metadata·result를 찾으세요.

    2. 개념

      complete binary tree·zero-based index·last internal node를 ADT·topology·source-level로 나눠 적으세요.

    3. 다음 도움

      내 생각을 먼저 적고 ‘내 답과 맞춰 볼 기준 보기’을 누르면, 풀 순서와 더 자세한 도움을 열어 드려요.

    정답과 비교
  8. 08

    새 문제에 써보기 · 새 문제

    th29 transfer · complete binary shape와 parent/child array index: compact priority index·memory layout explanation로 판단을 옮겨 보존할 invariant와 달라지는 API·cost·ownership 경계를 방어한다.

    이 문제는 주어진 내용과 정답 기준을 더 만드는 중이에요. 지금 적은 답은 연습 메모로만 저장돼요.

    정답 대신 4단계 힌트 보기
    1. 관찰

      1-based와 0-based 공식을 섞거나 right child가 array 밖인데도 읽는다. 직전까지 참이었던 root→node path와 처음 달라진 edge·index·metadata·result를 찾으세요.

    2. 개념

      complete binary tree·zero-based index·last internal node를 ADT·topology·source-level로 나눠 적으세요.

    3. 다음 도움

      내 생각을 먼저 적고 ‘내 답과 맞춰 볼 기준 보기’을 누르면, 풀 순서와 더 자세한 도움을 열어 드려요.

    설명 기준과 비교

8개 답이 남았습니다.

02 · 막힌 곳을 찾아요

틀린 답에서 생각이 갈라진 첫 지점 찾기

헷갈림 01

1-based와 0-based 공식을 섞거나 right child가 array 밖인데도 읽는다.

겉으로 보이는 막힘
complete binary shape와 parent/child array index 구현이 일부 예시는 통과하지만 node reachability·order·priority·size 결과를 재현하지 못한다.
막힌 까닭
binary heap은 level-order로 빈틈없이 채운 complete shape이며 0-based parent·left·right index 공식과 array length boundary를 함께 사용한다.을 첫 mutation 전에 봉인하지 않았다.
다시 해보는 방법
n=0·1·2·7 heap의 모든 valid parent-child edge를 계산한다.에서 node identity·edge/index·comparator와 state transition을 고정하고 tree node↔array index·parent/children·last internal node mapping 표를 다시 만든다.
헷갈림 02

최종 값만 기록하고 방문 순서·parent/child edge·array index·height/size metadata를 생략한다.

겉으로 보이는 막힘
wrong traversal, orphan subtree, broken rotation, heap-order violation 또는 stale rank가 남는다.
막힌 까닭
logical result와 structure representation·derived metadata를 분리하지 않았다.
다시 해보는 방법
tree node↔array index·parent/children·last internal node mapping 표에 각 operation의 최초 divergence와 mutation 전후 invariant를 함께 기록한다.
헷갈림 03

단일 합성 trace나 abstract complexity를 특정 library layout·stable tie·atomicity·대회 결과로 확대한다.

겉으로 보이는 막힘
compact priority index·memory layout explanation에서 comparator mismatch·invalidation·latency spike·race·scope 오류를 놓친다.
막힌 까닭
표준·API·구현·측정·competition scope를 서로 다른 claim level로 기록하지 않았다.
다시 해보는 방법
1-based와 0-based 공식을 섞거나 right child가 array 밖인데도 읽는다. fixture의 claim을 좁히고 source version·unknown·measurement를 별도 evidence로 둔다.

03 · 내게 맞는 도움 고르기

같은 목표를 원하는 도움만큼 연습해요

안내 받으며

안내형

complete binary tree · zero-based index · last internal node node 카드와 edge/array 표를 제공하고 색상 외에도 node id·key·depth/index·height/size·priority·result label을 표시한다.

complete binary shape와 parent/child array index에서 root와 node edge, traversal 또는 mutation path, height·size·priority와 결과를 추적하는 설명도에서 색상뿐 아니라 node id·key·parent/child·depth/index·subtree·balance·priority·comparator·operation·claim-level을 문자와 선 종류로 표시한다.
혼자 해보기

내 힘으로

complete binary shape와 parent/child array index의 미공개 node stream에서 contract·path·mutation·height/work/space·source claim을 독립 재구성하는 능력의 처음 보는 frozen tree·heap state를 AI 없이 분석하고 expected invariant·path·mutation·cost·boundary verdict를 봉인한 뒤 실행 관찰과 대조한다.

공식 정의·API 문법·도구 사용법은 열 수 있지만 해당 변형의 최종 traversal, rotation, tree/heap state, comparator verdict, hidden fixture와 structure 선택은 먼저 제공하지 않는다.
더 도전하기

심화형

compact priority index·memory layout explanation에서 adversarial key order·duplicate/tie·memory cap·concurrent mutation 중 두 축을 추가하고 판정이 바뀌는 최소 trace를 찾는다.

더 풍부한 augmentation과 source ledger는 오류 탐지력을 높이지만 mutation·검토 비용도 늘리므로 decision-changing edge·rotation·sift·metadata event를 우선 기록한다.