Files
hello-algo/docs/chapter_stack_and_queue/queue.assets/queue_operations.a11y.json
T
Yudong JinandClaude Opus 5.5 2c043775ac feat: add and refine screen-reader descriptions for all website figures (#2040)
* feat: preserve complete figure accessibility baseline

* feat: provide stable accessible animation state

* feat: complete reviewed figure reading candidate

* Revert the runnable-snippets batches to the #2033 state

Reverts #2034, #2035, #2036 and #2037. The work will return in a single
reviewed PR that is completed before it merges. The tree equals 8c96e2f30
(#2033).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore: bind figure descriptions to current source snippets

* chore: bind figure descriptions to the reverted snippet baseline

* refactor: keep one figure annotation source and hidden step feedback

* Keep figure annotations exclusive to website reading

* refine all figure reading descriptions after independent reader reviews

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-18 03:51:57 +08:00

111 lines
4.6 KiB
JSON

{
"schema_version": 2,
"title": "队列的入出操作",
"summary": "队尾加入、队首取出,体现先入先出。",
"context": [
"所有序列按队首到队尾书写。图中 push 向队尾入队,pop 从队首出队并返回该元素。"
],
"description": [
"五个竖直面板从左到右由箭头串联,依次对应下表五行。每个面板上端为队首、下端为队尾;入队箭头从下方进入,出队箭头从上方离开。",
"虚线方块仅示意元素操作前的旧位置,不重复计入当前队列;移出容器外的实心方块表示本次 pop 的返回值。"
],
"frames": [
{
"id": "source-63",
"book_path": "chapter_stack_and_queue/queue.assets/queue_operations.png",
"title": "队列的入出操作",
"explanation": "新元素只能排在队尾,原有元素次序不变。因此加入 5、4 后,连续出队仍先取出原队首 1,再取出 3,体现先入先出。"
}
],
"animations": {
"flow-queue-operations": {
"kind": "prose",
"prose": {
"title": "队列的入出操作",
"summary": "队尾加入、队首取出,体现先入先出。",
"context": [
"所有序列按队首到队尾书写。图中 push 向队尾入队,pop 从队首出队并返回该元素。"
],
"description": [
"虚线方块仅示意元素操作前的旧位置,不重复计入当前队列;移出容器外的实心方块表示本次 pop 的返回值。"
],
"steps": [
{
"id": "step-1",
"title": "初始",
"explanation": "初始队列。当前队列按队首到队尾为 [1, 3, 2],共 3 个元素,队首 1、队尾 2;无返回值。",
"key_state": "初始:队列(队首到队尾)[1, 3, 2],队首 1、队尾 2,无返回值。",
"announcement": "初始队列为 [1, 3, 2],队首 1、队尾 2。"
},
{
"id": "step-2",
"title": "push(5)",
"explanation": "执行 push(5),把 5 加到队尾,原有元素次序不变。当前队列按队首到队尾为 [1, 3, 2, 5],共 4 个元素,队首 1、队尾 5;无返回值。",
"key_state": "push(5) 后:队列(队首到队尾)[1, 3, 2, 5],队首 1、队尾 5,无返回值。",
"announcement": "队尾加入 5,新队尾为 5。"
},
{
"id": "step-3",
"title": "push(4)",
"explanation": "执行 push(4),把 4 加到队尾,排在 5 之后。当前队列按队首到队尾为 [1, 3, 2, 5, 4],共 5 个元素,队首 1、队尾 4;无返回值。",
"key_state": "push(4) 后:队列(队首到队尾)[1, 3, 2, 5, 4],队首 1、队尾 4,无返回值。",
"announcement": "队尾加入 4,新队尾为 4。"
},
{
"id": "step-4",
"title": "第一次 pop()",
"explanation": "第一次执行 pop(),移除并返回队首 1,其后继 3 成为新队首。当前队列按队首到队尾为 [3, 2, 5, 4],共 4 个元素,队首 3、队尾 4;本次返回 1,已移出队列外。",
"key_state": "第一次 pop() 后:队列(队首到队尾)[3, 2, 5, 4],队首 3、队尾 4,本次返回 1。",
"announcement": "队首取出并返回 1,新队首为 3。"
},
{
"id": "step-5",
"title": "第二次 pop()",
"explanation": "第二次执行 pop(),移除并返回队首 3,2 成为新队首。当前队列按队首到队尾为 [2, 5, 4],共 3 个元素,队首 2、队尾 4;本次返回 3,已移出队列外。",
"key_state": "第二次 pop() 后:队列(队首到队尾)[2, 5, 4],队首 2、队尾 4,本次返回 3。",
"announcement": "队首取出并返回 3,剩余队列为 [2, 5, 4]。"
}
]
}
}
},
"tables": [
{
"caption": "队列每次操作后的内容",
"headers": [
"操作",
"有效序列(队首到队尾)",
"本次返回"
],
"rows": [
[
"初始",
"[1, 3, 2]",
"无"
],
[
"push(5)",
"[1, 3, 2, 5]",
"无"
],
[
"push(4)",
"[1, 3, 2, 5, 4]",
"无"
],
[
"第一次pop()",
"[3, 2, 5, 4]",
"1"
],
[
"第二次pop()",
"[2, 5, 4]",
"3"
]
],
"row_header": 0
}
]
}