What is a tree?
A tree is a hierarchical, acyclic data structure made of nodes connected by edges, accessed from a distinguished root.
Study 6 Trees and Binary Search Trees with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is a tree?
A tree is a hierarchical, acyclic data structure made of nodes connected by edges, accessed from a distinguished root.
What is a node's depth?
A node's depth is the number of edges from the root to that node. With root depth 0, node D has depth 2 in the example tree.
What defines a binary tree?
A binary tree is a tree in which each node has at most two children, conventionally called the left child and right child.
What is a full binary tree?
A full binary tree has either zero children or exactly two children at every node.
How many nodes are in a perfect tree of height h?
A perfect binary tree of height h has exactly 2h+1−1 nodes.
What is preorder traversal order?
Preorder visits the current node, then the left subtree, then the right subtree: node-left-right.
Why is inorder traversal useful for a BST?
For a binary search tree, inorder traversal visits keys in sorted order because it processes left subtree, node, then right subtree.
How does level-order traversal process nodes?
Level-order traversal processes nodes by increasing depth, typically using a queue.
What is the base case for recursive node counting?
The recursive node-counting algorithm returns 0 for an empty subtree and otherwise returns 1+count(left)+count(right).
What is unordered binary-tree search complexity?
Searching an unordered binary tree has worst-case time complexity O(n), because both subtrees may need to be examined.
What ordering rule defines a BST?
A BST requires every key in the left subtree to be less than the node's key and every key in the right subtree to be greater.
What is the time complexity of BST search?
BST search takes O(h), where h is tree height, because each comparison follows only one child.
A progressive guide to how computers encode numbers, text, images, and sound as binary data, including the trade-offs and limits of digital representation.
A focused set of flashcards covering Python variables, data types, expressions, control flow, functions, input, output, and common programming practices.
Learn how Boolean expressions, logical operators, and conditional structures let programs make reliable decisions, including how to handle boundaries, branch order, and testing.
A structured guide to the main data structures, their operations, efficiency trade-offs, representations, and practical selection criteria.
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
A progression through how data is organized, searched, exposed through software interfaces, and managed through abstraction layers in modern computer systems.
A medium-difficulty quiz on integrating problem definition, representation, algorithms, complexity analysis, testing, correctness, ethical evaluation, and documentation in a computer science capstone.
A practical guide to integrating problem definition, data representation, modular programming, algorithms, complexity analysis, testing, correctness, and ethical evaluation into a responsible computer science capstone.
This quiz covers process management, context switching and scheduling, multitasking, traps and interrupts, and RISC-V privilege transitions.