V2EX  ›  英汉词典
Enqueued related words: Preorder Traversal, Postorder Traversal

Inorder Traversal

定义 Definition

(数据结构/算法)中序遍历:一种对二叉树进行遍历的方法,访问顺序为左子树 → 根节点 → 右子树。在二叉搜索树(BST)中,中序遍历通常会按从小到大输出键值。(也常写作 in-order traversal

发音 Pronunciation (IPA)

/ˌɪnˈɔːrdər trəˈvɜːrsəl/

例句 Examples

Inorder traversal visits the left child, then the node, then the right child.
中序遍历会先访问左孩子,再访问该节点,最后访问右孩子。

In a binary search tree, an inorder traversal returns the keys in sorted order, which makes it useful for printing a dictionary in alphabetical order.
在二叉搜索树中,中序遍历会按排序后的顺序输出键值,因此常用于按字母序打印词典条目。

词源 Etymology

inorderin(在……之内/按……方式)与 order(顺序)构成,表示“按某种规定顺序进行”;traversal 来自 traverse(穿越、遍历),在计算机科学语境中引申为“对数据结构进行系统访问”。合起来即“按中序规则进行遍历”。

相关词 Related Words

文学与经典作品 Literary & Notable Works

  • Introduction to Algorithms(《算法导论》, Cormen/Leiserson/Rivest/Stein):在树与二叉搜索树相关章节中讨论遍历(包括中序遍历)的概念与用途。
  • The Art of Computer Programming, Volume 1: Fundamental Algorithms(《计算机程序设计艺术》卷1,Knuth):在基础数据结构与树相关内容中涉及遍历思想。
  • Data Structures and Algorithms in Java(Goodrich/Tamassia/Goldwasser):在树结构章节中系统介绍多种遍历方式(含中序遍历)。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   840 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 23:33 · PVG 07:33 · LAX 15:33 · JFK 18:33
♥ Do have faith in what you're doing.