FlashKeepers

Computer Science · College · College and University

Data Structures, Unit 5: Trees and Binary Search Trees

Data Structures, unit: Trees and Binary Search Trees. Core concepts, terminology, and worked-example cues a college student meets for this unit, building on prior units without repeating them. Front: a term, concept, or short problem cue. Back: the definition, explanation, or answer.

About this set

38 basic cards for College Computer Science. Set 5 of 10 in Data Structures. It opens with "What is a tree, as a data structure?" and "What is the root of a tree?". Study it alongside the other College sets below.

38 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What is a tree, as a data structure?
Show answerA hierarchical structure of nodes connected by edges, with one root and no cycles
What is the root of a tree?
Show answerThe topmost node, with no parent
What is a leaf node?
Show answerA node with no children
What is the height of a tree?
Show answerThe length of the longest path from the root to a leaf
What is a binary tree?
Show answerA tree where each node has at most two children
What is a binary search tree (BST)?
Show answerA binary tree where each node's left subtree contains smaller values and right subtree contains larger values
What is the time complexity of searching a balanced binary search tree?
Show answerO(log n)
What is the time complexity of searching an unbalanced (degenerate) binary search tree?
Show answerO(n) in the worst case
What is tree traversal?
Show answerVisiting all nodes of a tree in a systematic order
What is inorder traversal?
Show answerVisiting left subtree, then the node, then right subtree
What is preorder traversal?
Show answerVisiting the node first, then left subtree, then right subtree
What is postorder traversal?
Show answerVisiting left subtree, then right subtree, then the node last
What does an inorder traversal of a binary search tree produce?
Show answerThe values in sorted order
What is a balanced binary tree?
Show answerA tree where the height difference between left and right subtrees is minimized at every node
What is an AVL tree?
Show answerA self-balancing binary search tree that maintains balance after every insertion or deletion

23 more cards in the app

Study this set free