Изменения

Перейти к: навигация, поиск

Участник:Artem.ustinov/НВП

170 байт добавлено, 04:01, 7 января 2018
Пример: Изменил цвета, поместил всё в тех
{| class="wikitable" style="text-align:center"
| Блок ||style="background:#FF8080FFC9C9"|<tex>1</tex>||style="background:#FF8080FFC9C9"|<tex>1</tex>||style="background:#FF8080FFC9C9"|<tex>1</tex>||style="background:#FF8080FFC9C9"|<tex>1</tex>||style="background:#FF8080FFC9C9"|<tex>1</tex>||style="background:#80FF80B9FFB9"|<tex>2</tex>||style="background:#80FF80B9FFB9"|<tex>2</tex>||style="background:#80FF80B9FFB9"|<tex>2</tex>||style="background:#80FF80B9FFB9"|<tex>2</tex>||style="background:#80FF80B9FFB9"|<tex>2</tex>||style="background:#8080FFCFCFFF"|<tex>3</tex>||style="background:#8080FFCFCFFF"|<tex>3</tex>
|-
|<tex>\pi</tex>||style="background:#FF8080FFC9C9"|<tex>9</tex>||style="background:#FF8080FFC9C9"|<tex>3</tex>||style="background:#FF8080FFC9C9"|<tex>10</tex>||style="background:#FF8080FFC9C9"|<tex>4</tex>||style="background:#FF8080FFC9C9"|<tex>8</tex>||style="background:#80FF80B9FFB9"|<tex>1</tex>||style="background:#80FF80B9FFB9"|<tex>2</tex>||style="background:#80FF80B9FFB9"|<tex>12</tex>||style="background:#80FF80B9FFB9"|<tex>6</tex>||style="background:#80FF80B9FFB9"|<tex>5</tex>||style="background:#8080FFCFCFFF"|<tex>7</tex>||style="background:#8080FFCFCFFF"|<tex>11</tex>
|}
После сортировки:
{| class="wikitable" style="text-align:center"
|Блок ||style="background:#FF8080FFC9C9"|<tex>1</tex>||style="background:#FF8080FFC9C9"|<tex>1</tex>||style="background:#FF8080FFC9C9"|<tex>1</tex>||style="background:#FF8080FFC9C9"|<tex>1</tex>||style="background:#FF8080FFC9C9"|<tex>1</tex>||style="background:#80FF80B9FFB9"|<tex>2</tex>||style="background:#80FF80B9FFB9"|<tex>2</tex>||style="background:#80FF80B9FFB9"|<tex>2</tex>||style="background:#80FF80B9FFB9"|<tex>2</tex>||style="background:#80FF80B9FFB9"|<tex>2</tex>||style="background:#8080FFCFCFFF"|<tex>3</tex>||style="background:#8080FFCFCFFF"|<tex>3</tex>
|-
|<tex>\pi</tex> ||style="background:#FF8080FFC9C9"|<tex>3</tex>||style="background:#FF8080FFC9C9"|<tex>4</tex>||style="background:#FF8080FFC9C9"|<tex>8</tex>||style="background:#FF8080FFC9C9"|<tex>9</tex>||style="background:#FF8080FFC9C9"|<tex>10</tex>||style="background:#80FF80B9FFB9"|<tex>1</tex>||style="background:#80FF80B9FFB9"|<tex>2</tex>||style="background:#80FF80B9FFB9"|<tex>5</tex>||style="background:#80FF80B9FFB9"|<tex>6</tex>||style="background:#80FF80B9FFB9"|<tex>12</tex>||style="background:#8080FFCFCFFF"|<tex>7</tex>||style="background:#8080FFCFCFFF"|<tex>11</tex>
|}
! colspan="6"|Первый блок
|-
| <tex>\pi</tex> ||style="background:#FFA080"|<tex>9</tex>||style="background:#FFDF80"|<tex>3</tex>||style="background:#FF9580"|<tex>10</tex>||style="background:#FFD580"|<tex>4</tex>||style="background:#FFAA80"|<tex>8</tex>
|-
|key ||style="background:#FF9980"|<tex>4</tex>||style="background:#FFE680"|<tex>1</tex>||style="background:#FF8080"|<tex>5</tex>||style="background:#FFCC80"|<tex>2</tex>||style="background:#FFB380"|<tex>3</tex>
|}
| ||
! colspan="6"|Cортированный
|-
| <tex>\pi</tex> ||style="background:#FFDF80"|<tex>3</tex>||style="background:#FFD580"|<tex>4</tex>||style="background:#FFAA80"|<tex>8</tex>||style="background:#FFA080"|<tex>9</tex>||style="background:#FF9580"|<tex>10</tex>
|-
|key ||style="background:#FFE680"|<tex>1</tex>||style="background:#FFCC80"|<tex>2</tex>||style="background:#FFB380"|<tex>3</tex>||style="background:#FF9980"|<tex>4</tex>||style="background:#FF8080"|<tex>5</tex>
|}
|}
Обработка блока с помощью алгоритма <tex>\mathrm{LIS}</tex>.
{| class="wikitable" style="center" style="background: #ffffcc"
! <tex>B_1</tex>||<tex>B_2</tex>||<tex>B_3</tex>||<tex>key</tex>||<tex>\pi</tex>
|-align="center"
| style="background:#FFCC00FFC9C9"| <tex>4 </tex> || || || style="background: #77A9F4CFCFFF"| <tex>4 </tex> || style="background: #9ACD32B9FFB9"| <tex>9</tex>
|-align="center"
| style="background:#FFCC00FFC9C9"| <tex>1 </tex> || || || style="background: #77A9F4CFCFFF"| <tex>1 </tex> || style="background: #9ACD32B9FFB9"| <tex>3</tex>
|-align="center"
| <tex>1</tex> || style="background:#FFCC00FFC9C9"| <tex>5 </tex> || || style="background: #77A9F4CFCFFF"| <tex>5 </tex> || style="background: #9ACD32B9FFB9"| <tex>10</tex>
|-align="center"
| <tex>1</tex> || style="background:#FFCC00FFC9C9"| <tex>2 </tex> || || style="background: #77A9F4CFCFFF"| <tex>2 </tex> || style="background: #9ACD32B9FFB9"| <tex>4</tex>
|-align="center"
| <tex>1</tex> || <tex>2</tex> || style="background:#FFCC00FFC9C9"| <tex>3 </tex> || style="background: #77A9F4CFCFFF"| <tex>3 </tex> || style="background: #9ACD32B9FFB9"| <tex>8</tex>
|}
! colspan="6"|Второй блок
|-
| <tex>\pi</tex> ||style="background:#FFF480"|<tex>1</tex>||style="background:#FFEA80"|<tex>2</tex>||style="background:#FF8080"|<tex>12</tex>||style="background:#FFC080"|<tex>6</tex>||style="background:#FFCA80"|<tex>5</tex>
|-
| key ||style="background:#FFE680"|<tex>1</tex>||style="background:#FFCC80"|<tex>2</tex>||style="background:#FF8080"|<tex>8</tex>||style="background:#FF9980"|<tex>6</tex>||style="background:#FFB380"|<tex>5</tex>
|}
| ||
! colspan="6"|Cортированный
|-
| <tex>\pi</tex> ||style="background:#FFF480"|<tex>1</tex>||style="background:#FFEA80"|<tex>2</tex>||style="background:#FFCA80"|<tex>5</tex>||style="background:#FFC080"|<tex>6</tex>||style="background:#FF8080"|<tex>12</tex>
|-
| key ||style="background:#FFE680"|<tex>1</tex>||style="background:#FFCC80"|<tex>2</tex>||style="background:#FFB380"|<tex>5</tex>||style="background:#FF9980"|<tex>6</tex>||style="background:#FF8080"|<tex>8</tex>
|}
|}
Обновляем ключи в очереди:
{| class="wikitable" style="center" style="background: #ffffcc"
! <tex>B_1</tex>||<tex>B_2</tex>||<tex>B_3</tex>||<tex>\pi</tex>
|-align="center"
| style="background:#FFCC00FFC9C9"| <tex>3 </tex> || || || style="background: #77A9F4CFCFFF"| <tex>3</tex>
|-align="center"
| <tex>3</tex> || style="background:#FFCC00FFC9C9"| <tex>4 </tex> || || style="background: #77A9F4CFCFFF"| <tex>4</tex>
|-align="center"
| <tex>3</tex> || <tex>4</tex> || style="background:#FFCC00FFC9C9"| <tex>7 </tex> || style="background: #77A9F4CFCFFF"| <tex>7</tex>
|}
запускаем <tex>\mathrm{LIS}</tex> для блока:
{| class="wikitable" style="center" style="background: #ffffcc"
! <tex>B_1</tex>||<tex>B_2</tex>||<tex>B_3</tex>||<tex>B_4</tex>||<tex>key</tex>||<tex>\pi</tex>
|-align="center"
| style="background:#FFCC00FFC9C9"| <tex>1 </tex> || <tex>4</tex> || <tex>7</tex> || || style="background: #77A9F4CFCFFF"| <tex>1 </tex> || style="background: #9ACD32B9FFB9"| <tex>1</tex>
|-align="center"
| <tex>1</tex> || style="background:#FFCC00FFC9C9"| <tex>2 </tex> || <tex>7</tex> || || style="background: #77A9F4CFCFFF"| <tex>2 </tex> || style="background: #9ACD32B9FFB9"| <tex>2</tex>
|-align="center"
| <tex>1</tex> || <tex>2</tex> || <tex>7</tex> || style="background:#FFCC00FFC9C9"| <tex>8 </tex> || style="background: #77A9F4CFCFFF"| <tex>8 </tex> || style="background: #9ACD32B9FFB9"| <tex>12</tex>
|-align="center"
| <tex>1</tex> || <tex>2</tex> || style="background:#FFCC00FFC9C9"| <tex>6 </tex> || <tex>8</tex> || style="background: #77A9F4CFCFFF"| <tex>6 </tex> || style="background: #9ACD32B9FFB9"| <tex>6</tex>
|-align="center"
| <tex>1</tex> || <tex>2</tex> || style="background:#FFCC00FFC9C9"| <tex>5 </tex> || <tex>8</tex> || style="background: #77A9F4CFCFFF"| <tex>5 </tex> || style="background: #9ACD32B9FFB9"| <tex>5</tex>
|}
! colspan="3"| Третий блок
|-
| <tex>\pi</tex> ||style="background:#FFB580"|<tex>7</tex>||style="background:#FF8B80"|<tex>11</tex>
|-
| key ||style="background:#FFC080"|<tex>4</tex>||style="background:#FF8080"|<tex>5</tex>
|}
| ||
! colspan="3"|Cортированный
|-
| <tex>\pi</tex> ||style="background:#FFB580"|<tex>7</tex>||style="background:#FF8B80"|<tex>11</tex>
|-
| key ||style="background:#FFC080"|<tex>4</tex>||style="background:#FF8080"|<tex>5</tex>
|}
|}
Обновление старых ключей:
{| class="wikitable" style="center" style="background: #ffffcc"
! <tex>B_1</tex>||<tex>B_2</tex>||<tex>B_3</tex>||<tex>B_4</tex>||<tex>\pi</tex>
|-align="center"
| style="background:#FFCC00FFC9C9"| <tex>1 </tex> || || || || style="background: #77A9F4CFCFFF"| <tex>1</tex>
|-align="center"
| <tex>1</tex> || style="background:#FFCC00FFC9C9"| <tex>2 </tex> || || || style="background: #77A9F4CFCFFF"| <tex>2</tex>
|-align="center"
| <tex>1</tex> || <tex>2</tex> || style="background:#FFCC00FFC9C9"| <tex>3 </tex> || || style="background: #77A9F4CFCFFF"| <tex>3</tex>
|-align="center"
| <tex>1</tex> || <tex>2</tex> || <tex>3</tex> || style="background:#FFCC00FFC9C9"| <tex>6 </tex> || style="background: #77A9F4CFCFFF"| <tex>6</tex>
|}
запускаем <tex>\mathrm{LIS}</tex> для блока:
{| class="wikitable" style="center" style="background: #ffffcc"
! <tex>B_1</tex>||<tex>B_2</tex>||<tex>B_3</tex>||<tex>B_4</tex>||<tex>B_5</tex>||<tex>key</tex>||<tex>\pi</tex>
|-align="center"
| <tex>1</tex> || <tex>2</tex> || <tex>3</tex> || style="background:#FFCC00FFC9C9"| <tex>4 </tex> || || style="background: #77A9F4CFCFFF"| <tex>4 </tex> || style="background: #9ACD32B9FFB9"| <tex>7</tex>
|-align="center"
| <tex>1</tex> || <tex>2</tex> || <tex>3</tex> || <tex>4</tex> || style="background:#FFCC00FFC9C9"| <tex>5 </tex> || style="background: #77A9F4CFCFFF"| <tex>5 </tex> || style="background: #9ACD32B9FFB9"| <tex>11</tex>
|}
Результат завершения алгоритма:
76
правок

Навигация