Изменения

Перейти к: навигация, поиск
Построение кода Хаффмана
4 '''for''' <math>\mathrm{i}</math> = 1 '''to''' <math>\mathrm{n}</math> - 1
5 <math>\mathrm{x}</math> = <math>\mathrm{Q}</math>.extract_min() //extract_min - изъятие из множества наименьшего элемента
6 left[<math>\mathrm{z}</math>] .left = <math>\mathrm{x}</math>
7 <math>\mathrm{y}</math> = <math>\mathrm{Q}</math>.extract_min()
8 right[<math>\mathrm{z}</math>] .right = <math>\mathrm{y}</math>
9 <math>\mathrm{f}</math>[<math>\mathrm{z}</math>] = <math>\mathrm{f}</math>[<math>\mathrm{x}</math>] + <math>\mathrm{f}</math>[<math>\mathrm{y}</math>]
10 Insert(<math>\mathrm{Q}</math>, <math>\mathrm{z}</math>)
Анонимный участник

Навигация