«binary-trees» 태그된 질문

각 노드에 자식이 두 명 이하인 트리


2
BST에서 검색 할 때 가능한 검색 경로 수
다음 질문이 있지만 이에 대한 답변이 없습니다. 내 방법이 올바른지 감사하겠습니다. Q. 이진 검색 트리에서 키 값 60을 검색 할 때 키 값 10, 20, 40, 50, 70, 80, 90을 포함하는 노드는 반드시 주어진 순서대로 진행되지 않습니다. 값 60이 포함 된 루트 노드의 검색 경로에서 이러한 키 값이 발생할 수있는 …


1
구체화 유형 추론
직장에서 나는 동적 언어에 대한 몇 가지 유형 정보를 유추하는 임무를 맡았습니다. 다음 let과 같이 일련의 명령문을 중첩 된 표현식 으로 다시 작성합니다 . return x; Z => x var x; Z => let x = undefined in Z x = y; Z => let x = y in Z …
11 programming-languages  logic  type-theory  type-inference  machine-learning  data-mining  clustering  order-theory  reference-request  information-theory  entropy  algorithms  algorithm-analysis  space-complexity  lower-bounds  formal-languages  computability  formal-grammars  context-free  parsing  complexity-theory  time-complexity  terminology  turing-machines  nondeterminism  programming-languages  semantics  operational-semantics  complexity-theory  time-complexity  complexity-theory  reference-request  turing-machines  machine-models  simulation  graphs  probability-theory  data-structures  terminology  distributed-systems  hash-tables  history  terminology  programming-languages  meta-programming  terminology  formal-grammars  compilers  algorithms  search-algorithms  formal-languages  regular-languages  complexity-theory  satisfiability  sat-solvers  factoring  algorithms  randomized-algorithms  streaming-algorithm  in-place  algorithms  numerical-analysis  regular-languages  automata  finite-automata  regular-expressions  algorithms  data-structures  efficiency  coding-theory  algorithms  graph-theory  reference-request  education  books  formal-languages  context-free  proof-techniques  algorithms  graph-theory  greedy-algorithms  matroids  complexity-theory  graph-theory  np-complete  intuition  complexity-theory  np-complete  traveling-salesman  algorithms  graphs  probabilistic-algorithms  weighted-graphs  data-structures  time-complexity  priority-queues  computability  turing-machines  automata  pushdown-automata  algorithms  graphs  binary-trees  algorithms  algorithm-analysis  spanning-trees  terminology  asymptotics  landau-notation  algorithms  graph-theory  network-flow  terminology  computability  undecidability  rice-theorem  algorithms  data-structures  computational-geometry 

2
같은 수의 0과 1을 가진 모든 이진 시퀀스를 어떻게 효율적으로 생성합니까?
이진 계열 길이가 단 정렬 순서되고 각각의 것을 하나이고 0 또는 1 . 이러한 모든 이진 시퀀스를 생성하기 위해 다음과 같은 방식으로 명백한 이진 트리 구조를 사용할 수 있습니다. 루트는 "빈"이지만 각 왼쪽 자식 은 기존 문자열 에 0 을 추가 하고 오른쪽 자식을 1에 추가합니다 . 이제 각 이진 …


2
이진 트리의 평균 높이는 얼마입니까?
이진 트리의 평균 높이에 대한 공식적인 정의가 있습니까? 다음 두 가지 방법을 사용하여 이진 트리의 평균 높이를 찾는 방법에 대한 자습서 질문이 있습니다. 자연적인 해결책은 가능한 모든 경로의 평균 길이를 뿌리에서 잎으로 가져 오는 것입니다. 아1( T) = 1# T에 나뭇잎 ⋅ ∑V 의 잎 T깊이( V )avh1⁡(T)=1# leaves in …

1
이진 색인 트리가있는 범위 업데이트 + 범위 쿼리
범위 쿼리 및 범위 업데이트를 처리하기 위해 이진 색인 트리 (fenwick tree)를 수정하는 방법을 이해하려고합니다. 다음과 같은 출처를 찾았습니다. http://kartikkukreja.wordpress.com/2013/12/02/range-updates-with-bit-fenwick-tree/ http://programmingcontests.quora.com/Tutorial-Range-Updates-in-Fenwick-Tree http : //apps.topcoder.com/forums/? module = Thread & threadID = 756271 & start = 0 & mc = 4 # 1579597 그러나 모든 것을 읽은 후에도 두 번째 이진 색인 …

3
이진 트리의 최소 높이가 왜
Java 클래스에서는 다양한 유형의 컬렉션의 복잡성에 대해 배우고 있습니다. 곧 우리는 이진 트리에 대해 이야기 할 것입니다. 이 책은 이진 트리의 최소 높이가log2( n + 1 ) − 1log2⁡(n+1)−1\log_2(n+1) - 1자세한 설명은 제공하지 않습니다. 누군가 이유를 설명 할 수 있습니까?

1
홀수 회전의 재생 트리
스플레이 트리에 항목을 삽입 할 때 지그재그 또는 지그재그 패턴을 기준으로 한 쌍으로 회전이 수행됩니다. 홀수의 회전이 수행되는 경우 리프에서 시작하여 추가 회전을 수행하거나 추가 회전을 저장하고 루트에서 수행 할 수 있습니다. 그게 그렇게 중요한 건가? 예를 들어, 첨부 된 이미지에서 BST에 4를 삽입하고 루트에 "재생"합니다. 그림의 맨 위에는 먼저 …

3
로그 대 더블 로그 시간 복잡성
실제 응용 프로그램에서는 알고리즘 대신 사용할 때 이점이 있습니까?O(log(log(n))O(log⁡(log⁡(n))\mathcal{O}(\log(\log(n))O(log(n))O(log⁡(n))\mathcal{O}(\log(n)) 예를 들어보다 일반적인 이진 검색 트리 구현 대신 van Emde Boas 트리를 사용하는 경우입니다. 그러나 예를 들어, 우리가 을 취 하면 가장 좋은 경우에 이중 로그 알고리즘은 의 인수 (대략)만큼 로그를 능가합니다 . 또한 일반적으로 구현이 더 까다 롭고 복잡합니다.n&lt;106n&lt;106n < …
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.