CCP Data Structures & Abstract Data Types Flashcards
6 cards from real CCP practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 CCP Data Structures & Abstract Data Types flashcards as text
In a binary tree, a node with no children is called a:
Answer: Leaf
A leaf node is a node in a binary tree that has no left or right child.
A hash table resolves collisions using chaining by storing colliding elements in a:
Answer: Linked list at each bucket
Chaining stores all keys that hash to the same bucket in a linked list attached to that bucket.
What is the average-case time complexity for searching in a balanced binary search tree (BST)?
Answer: O(log n)
A balanced BST halves the search space at each level, yielding O(log n) average-case search time.
Which graph representation uses a 2D matrix to indicate edges between vertices?
Answer: Adjacency matrix
An adjacency matrix uses an n×n boolean (or weighted) matrix where entry [i][j] indicates an edge from vertex i to vertex j.
A priority queue dequeues elements based on:
Answer: Assigned priority value
A priority queue always removes the element with the highest (or lowest) priority value, regardless of insertion order.
Which property of a binary heap ensures the parent node's key is always greater than or equal to its children's keys?
Answer: Max-heap property
The max-heap property states that every parent node has a key ≥ its children, placing the maximum at the root.