Temporal Data Structures
- 60Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the central goal of succinct data structures?
What is the central goal of succinct data structures?
60 questions
- 1
What is the central goal of succinct data structures?
- A
To store information using close to the minimum number of bits implied by the number of possible states
- B
To reduce every query to constant time by duplicating the stored information
- C
To make data structures efficient only when their contents are strings
- D
To represent all data using pointers rather than integer values
Correct answer
ATo store information using close to the minimum number of bits implied by the number of possible states
Explanation
If there are 2n possible states, distinguishing among them requires at least n bits. Succinct data structures aim to approach that minimum, perhaps with only a small additional space cost.
- A
- 2
Why can algorithms sometimes perform better when they know their keys are integers rather than arbitrary objects?
- A
Arbitrary objects cannot be stored in pointer-machine data structures
- B
Integer keys always arrive in sorted order, eliminating the need for updates
- C
Integer representations can support operations beyond comparisons, enabling faster data structures
- D
Integer keys make the number of stored items independent of the input size
Correct answer
CInteger representations can support operations beyond comparisons, enabling faster data structures
Explanation
Knowing that data consists of integers gives an algorithm more structure to exploit than treating items as black boxes that can only be compared. The content notes that integer data structures can often beat logarithmic time and may sometimes achieve constant time.
- A
- 3
Which problem best illustrates the dynamic-graph setting described in the content?
- A
Sorting a static set of integer keys once
- B
Choosing a cache size before any data is processed
- C
Maintaining information about a social network as friendships are added and removed
- D
Finding a fixed substring in an unchanging text document
Correct answer
CMaintaining information about a social network as friendships are added and removed
Explanation
A dynamic graph changes as edges are inserted or deleted. A social network, where people friend and unfriend one another, is the example given.
- A
- 4
What is the main computational challenge in searching for a substring in a large text or DNA sequence?
- A
Keeping every historical version of a priority queue
- B
Maintaining a graph while its vertices are repeatedly deleted
- C
Reducing the number of dimensions in a geometric data set
- D
Finding occurrences of a pattern efficiently within a potentially very large string
Correct answer
DFinding occurrences of a pattern efficiently within a potentially very large string
Explanation
String data structures address efficient pattern searching in large pieces of text, such as the web, or in DNA sequences.
- A
- 5
What does the memory-hierarchy model represent?
- A
A graph whose vertices are ordered by the number of times they have been updated
- B
A tree in which each node stores every possible integer key
- C
A computer with several levels of storage, such as cache and main memory, whose differing costs affect optimization
- D
A data structure that stores only the most recent version of a string
Correct answer
CA computer with several levels of storage, such as cache and main memory, whose differing costs affect optimization
Explanation
The memory-hierarchy model accounts for multiple levels of storage, including cache and main memory. An algorithm may need to optimize its behavior across those levels.
- A
- 6
Which question captures the dynamic-optimality topic introduced in the content?
- A
Whether a graph can be updated without representing its edges
- B
Whether a linked list can store more than one pointer per node
- C
Whether there is one binary search tree that is best for all relevant operations
- D
Whether every string can be encoded using exactly one bit
Correct answer
CWhether there is one binary search tree that is best for all relevant operations
Explanation
Dynamic optimality was framed as asking whether there is one best binary search tree that rules them all.
- A
- 7
Which statement best describes the role of hashing in the course overview?
- A
It is presented as a widely used and prominent data-structure technique
- B
It is presented as a technique that applies only to historical versions
- C
It is presented as a replacement for all forms of memory
- D
It is presented as a method used only for geometric data
Correct answer
AIt is presented as a widely used and prominent data-structure technique
Explanation
The content describes hashing as one of the most famous, popular, and widely used data-structure techniques in computer science.
- A
- 8
What distinction motivates studying higher-dimensional data structures in geometry?
- A
Higher-dimensional data can only be queried in historical versions
- B
Geometric data must be stored without any nodes or pointers
- C
Geometric data always consists of arbitrary objects that cannot be compared
- D
Geometric data may have more than one dimension, unlike data structures restricted to one dimension
Correct answer
DGeometric data may have more than one dimension, unlike data structures restricted to one dimension
Explanation
The overview contrasts familiar one-dimensional structures with geometry involving data in more than one dimension.
- A
- 9
What is the basic organization of memory in a pointer machine?
- A
A fixed sequence of bits with no references between locations
- B
A collection of nodes, each with a constant number of fields
- C
A tree whose nodes may have an unbounded number of fields
- D
A single unlimited array containing every possible data value
Correct answer
BA collection of nodes, each with a constant number of fields
Explanation
A pointer machine stores information in nodes with a constant number of fields. Fields can contain pointers, null pointers, or data.
- A
- 10
Which value is permitted in a pointer-machine field under the model described?
- A
An arbitrary-length list of pointers
- B
Only an integer, never a pointer
- C
A pointer to another node, a null pointer, or a data item
- D
Only a pointer to the root node
Correct answer
CA pointer to another node, a null pointer, or a data item
Explanation
Each field may contain a pointer to another node, a null pointer, or data; the content assumes data items are integers.
- A
- 11
What role does the root node play in the pointer-machine model?
- A
It provides a fixed starting point from which nodes can be reached by following pointers
- B
It prevents the data structure from containing cycles
- C
It stores every data item directly, so other nodes are unnecessary
- D
It changes whenever any field in any node is modified
Correct answer
AIt provides a fixed starting point from which nodes can be reached by following pointers
Explanation
The root is a node that remains available as a starting point. Operations can reach and manipulate other nodes by following pointers from it.
- A
- 12
Which operation is allowed in the pointer-machine model?
- A
Creating a node and reading or setting its fields
- B
Accessing any memory location by an unrestricted numerical address
- C
Reaching any node without following a pointer
- D
Using an arbitrarily large array as a primitive operation
Correct answer
ACreating a node and reading or setting its fields
Explanation
The model allows operations such as creating nodes, inspecting fields, setting fields, and computing on data. Access is organized around nodes and pointers.
- A
- 13
Why is a constant bound on the number of pointers into each node important for the partial-persistence transformation?
- A
It ensures that all versions form a linear sequence
- B
It guarantees that every node contains exactly one field
- C
It eliminates the need to store any modifications
- D
It bounds the number of incoming references that may need to be found and updated when a node is copied
Correct answer
DIt bounds the number of incoming references that may need to be found and updated when a node is copied
Explanation
When a node is copied, pointers to it may need updating. A constant bound on incoming pointers lets the transformation manage those references with constant overhead.
- A
- 14
What are back pointers used for in the persistence technique?
- A
They record the chronological order of every query
- B
They record which nodes point to a given node, making those references locatable
- C
They connect each version directly to every other version
- D
They store copies of all data items ever inserted
Correct answer
BThey record which nodes point to a given node, making those references locatable
Explanation
A back pointer points from a node to a node that refers to it. These references help locate pointers that must be redirected when a node is copied.
- A
- 15
Why are arrays not part of the pointer-machine model described?
- A
Arrays prevent nodes from having a constant number of fields
- B
The model organizes access through nodes and pointers rather than unrestricted indexed storage
- C
Arrays cannot store integers
- D
Arrays would force every version to be destroyed after an update
Correct answer
BThe model organizes access through nodes and pointers rather than unrestricted indexed storage
Explanation
The pointer machine is a model of memory organization based on nodes and pointers. The content explicitly notes that arrays are not allowed as primitive storage.
- A
- 16
What does persistence require of an update operation?
- A
It modifies only a query result and never changes the data structure
- B
It changes every existing version to match the newest state
- C
It acts relative to a specified version and produces a new version without erasing old ones
- D
It permanently deletes all versions older than the one being updated
Correct answer
CIt acts relative to a specified version and produces a new version without erasing old ones
Explanation
Under persistence, an update takes a specified version and returns a new version. Earlier versions remain available rather than being destroyed.
- A
- 17
What distinguishes partial persistence from full persistence?
- A
Partial persistence never stores updates, while full persistence stores only queries
- B
Partial persistence permits queries only on the latest version, while full persistence forbids queries
- C
Partial persistence combines versions, while full persistence deletes them
- D
Partial persistence permits updates only to the latest version, while full persistence permits updates to any version
Correct answer
DPartial persistence permits updates only to the latest version, while full persistence permits updates to any version
Explanation
Partial persistence allows updates only to the newest version, whereas full persistence allows any version to be updated.
- A
- 18
What is the shape of the version history in partial persistence?
- A
A directed acyclic graph, because versions can be merged
- B
A tree, because any historical version can branch
- C
A cycle, because updates can return to earlier versions
- D
A line, because each new version extends the latest one
Correct answer
DA line, because each new version extends the latest one
Explanation
In partial persistence, updates extend only the latest version, so the versions are linearly ordered.
- A
- 19
What is the shape of the version history in full persistence?
- A
A cycle, because each update points back to its parent
- B
A directed acyclic graph, because any two versions must be merged
- C
A line, because only the latest version can be updated
- D
A tree, because updating an older version creates a new branch
Correct answer
DA tree, because updating an older version creates a new branch
Explanation
Full persistence allows updates to any version. Such updates create branches, so versions form a tree.
- A
- 20
What extra capability defines confluent persistence?
- A
Changing nodes in place without retaining old versions
- B
Querying versions only when they form a single line
- C
Updating only the latest version and discarding the rest
- D
Combining two versions to create a new version
Correct answer
DCombining two versions to create a new version
Explanation
Confluent persistence permits combining two versions into a new version, in addition to retaining old versions.
- A
- 21
Why do versions form a directed acyclic graph under confluent persistence?
- A
All old versions are replaced by a single merged version
- B
Updates are allowed only on the newest version
- C
Every version must have exactly one predecessor and one successor
- D
A version may be formed from two earlier versions, creating multiple incoming histories without cycles
Correct answer
DA version may be formed from two earlier versions, creating multiple incoming histories without cycles
Explanation
Combining two versions gives a new version multiple sources in its history. Since old versions are retained and updates move forward, the history is a directed acyclic graph.
- A
- 22
Which statement best distinguishes functional data structures from the other persistence levels?
- A
They permit updates only to a single latest version
- B
They never modify nodes; changes are represented by creating new nodes
- C
They require every version to be combined with every other version
- D
They allow old nodes to be changed whenever a version is queried
Correct answer
BThey never modify nodes; changes are represented by creating new nodes
Explanation
In a functional data structure, nodes are never modified. New nodes must be created to represent changes, a stronger constraint than merely preserving old versions.
- A
- 23
Why can functional data structures provide persistence levels without extra version-destruction concerns?
- A
Because never destroying or modifying nodes also prevents the destruction of represented versions
- B
Because they do not support update operations
- C
Because their versions always form a line
- D
Because functional structures store only one version at a time
Correct answer
ABecause never destroying or modifying nodes also prevents the destruction of represented versions
Explanation
If nodes can never be destroyed or modified, versions represented using those nodes are naturally retained. This makes persistence properties available, though the functional restriction can limit efficiency.
- A
- 24
How are modifications represented in the partial-persistence method?
- A
As complete copies of the entire data structure after every update
- B
As records containing the version, the changed field, and the new value
- C
As pointers from every version to every field in the structure
- D
As queries stored without any associated version
Correct answer
BAs records containing the version, the changed field, and the new value
Explanation
Each modification record identifies when a change occurred, which field changed, and the value assigned to that field.
- A
- 25
How does the method read a field for a requested version?
- A
It scans every node in every version and selects the most common value
- B
It reads the field from the newest version, regardless of the requested version
- C
It starts from the node's original field value and applies the latest relevant recorded modification
- D
It reconstructs the entire history by copying all earlier data structures
Correct answer
CIt starts from the node's original field value and applies the latest relevant recorded modification
Explanation
The node stores an initial field value and a bounded list of modifications. To read at a version, the method selects the latest applicable modification, if any.
- A
- 26
What happens when a node has room in its modification area and one of its fields changes?
- A
A modification record is added for that field and value
- B
Every earlier version is changed to contain the new value
- C
The node is deleted and replaced by a root node
- D
The entire data structure is copied immediately
Correct answer
AA modification record is added for that field and value
Explanation
If the node is not full, the update is recorded by adding a modification. This is the inexpensive case of the method.
- A
- 27
What does the partial-persistence method do when a node's modification area is full?
- A
It creates a replacement node representing the latest state and retains the old node for earlier versions
- B
It stores the update in every node in the data structure
- C
It deletes the node and all versions that refer to it
- D
It stops accepting updates until all old versions are queried
Correct answer
AIt creates a replacement node representing the latest state and retains the old node for earlier versions
Explanation
When the modification area fills, a new node is created to represent the latest state. The old node remains available to represent earlier versions.
- A
- 28
After creating a replacement node in partial persistence, what must happen to current references to the old node?
- A
They must be redirected to the root regardless of their destination
- B
They must be left unchanged in every version
- C
They must be redirected to the replacement, while references needed by old versions remain valid
- D
They must all be deleted, including references used by old versions
Correct answer
CThey must be redirected to the replacement, while references needed by old versions remain valid
Explanation
The new version must use the replacement node, but older versions still need the old node. The method updates references for the current state while preserving historical representations.
- A
- 29
Why can updating references to a copied node require recursive operations?
- A
A pointer machine cannot represent a pointer to a new node
- B
Changing a pointer is itself a field modification that may need to be recorded persistently
- C
Recursive updates are required only to change integer data values
- D
Every pointer update requires rebuilding the entire version history
Correct answer
BChanging a pointer is itself a field modification that may need to be recorded persistently
Explanation
Pointers are stored in fields. Redirecting a pointer therefore involves modifying a field, which must be handled by the same persistence procedure and may trigger further updates.
- A
- 30
What does the potential argument for partial persistence use to pay for expensive node copying?
- A
The total number of data items in the input
- B
The number of versions that have never been updated
- C
The decrease in stored modifications when a full node is replaced by a fresh one
- D
The number of queries performed on the oldest version
Correct answer
CThe decrease in stored modifications when a full node is replaced by a fresh one
Explanation
A copied node's modifications are incorporated into its replacement, leaving the replacement with fresh modification capacity. The resulting potential decrease pays for the copying and recursive work.
- A
- 31
What performance guarantee is stated for the bounded-degree partial-persistence transformation?
- A
Linear overhead per query and constant space per stored version
- B
Logarithmic overhead per operation and space proportional to all possible states
- C
Constant amortized-factor overhead and constant additional space per change
- D
Constant worst-case time for all operations and no additional space
Correct answer
CConstant amortized-factor overhead and constant additional space per change
Explanation
For pointer-machine structures with bounded incoming pointers, the transformation achieves constant amortized multiplicative overhead and a constant amount of additional space per change.
- A
- 32
Why can the simple partial-persistence copying strategy fail for full persistence?
- A
Full persistence allows queries only on the latest version
- B
Full persistence does not allow nodes to store modifications
- C
An older, full node can be updated repeatedly, causing the same expensive copying work again and again
- D
An older node cannot have any incoming pointers
Correct answer
CAn older, full node can be updated repeatedly, causing the same expensive copying work again and again
Explanation
In full persistence, an update can repeatedly target the same old version. Merely creating a fresh node for a new branch does not make the original full node less full, so repeated updates can repeatedly trigger expensive copying.
- A
- 33
How does the full-persistence method handle a full node differently from the partial-persistence method?
- A
It discards all modifications and treats every version as identical
- B
It copies the entire structure but leaves the full node unchanged
- C
It forbids further updates to that version
- D
It splits the modifications into portions so the original node also has room for future updates
Correct answer
DIt splits the modifications into portions so the original node also has room for future updates
Explanation
The full-persistence method divides the modification history between nodes, reducing the load on the original node instead of only creating a fresh representation for the latest branch.
- A
- 34
Why is splitting a node's modifications in full persistence more complicated than dividing a list in half?
- A
Each modification must be assigned to every version in the DAG
- B
The node's fields cannot contain pointers
- C
The modifications are stored in an array that cannot be divided
- D
The modifications correspond to a branching tree of versions that must be partitioned into suitable subtrees
Correct answer
DThe modifications correspond to a branching tree of versions that must be partitioned into suitable subtrees
Explanation
Full persistence creates a tree of versions. The modifications associated with a node therefore have branching ancestry, so the split must separate appropriate parts of that tree rather than simply divide a chronological sequence.
- A
- 35
What is the purpose of representing a version-tree node by a beginning marker and an ending marker in a traversal order?
- A
It guarantees that the version tree has no branches
- B
It stores the values of all fields changed in that version
- C
It replaces all pointers between data-structure nodes
- D
It makes ancestor relationships detectable through the nesting order of the markers
Correct answer
DIt makes ancestor relationships detectable through the nesting order of the markers
Explanation
A traversal places the markers for a version around the markers of its descendants. This nesting makes it possible to test whether one version is an ancestor of another.
- A
- 36
What operations does the order-maintenance structure support in the full-persistence construction?
- A
Finding the integer stored at any address without following pointers
- B
Merging arbitrary data structures and deleting every historical version
- C
Inserting an item next to a given item and comparing the relative order of two items
- D
Converting every version tree into a balanced search tree
Correct answer
CInserting an item next to a given item and comparing the relative order of two items
Explanation
The construction uses an order-maintenance structure that supports insertion immediately before or after a specified item and constant-time relative-order queries.
- A
- 37
How does the marker ordering help decide whether a modification applies to a requested version?
- A
The modification applies when its version is an ancestor of the requested version
- B
The modification applies whenever its marker is later than the requested version's ending marker
- C
The modification applies only when its version is the latest version
- D
The modification applies only if the two versions are on separate branches
Correct answer
AThe modification applies when its version is an ancestor of the requested version
Explanation
A change made in an ancestor version belongs to the history of its descendant. The marker order permits the construction to test that ancestor relationship.
- A
- 38
Why must back pointers be maintained across all versions in full persistence?
- A
Any version may be updated, so references in historical branches can matter to later operations
- B
Full persistence permits queries only through back pointers
- C
The version tree cannot be traversed without storing all pointers twice
- D
Every node has exactly one incoming pointer in every version
Correct answer
AAny version may be updated, so references in historical branches can matter to later operations
Explanation
Unlike partial persistence, full persistence permits updates to any version. References in different branches therefore need to remain available and correctly represented.
- A
- 39
What kind of overhead is guaranteed by the described full-persistence transformation for bounded-degree pointer machines?
- A
Logarithmic worst-case overhead for every query
- B
Constant amortized overhead
- C
Linear overhead in the number of versions
- D
Constant worst-case overhead for every operation
Correct answer
BConstant amortized overhead
Explanation
The full-persistence result provides constant amortized overhead under the stated bounded-degree conditions. The content separately notes that worst-case deamortization is known for partial persistence, not that same guarantee for full persistence.
- A
- 40
What does the described deamortization result establish?
- A
Both partial and full persistence achieve zero overhead in every operation
- B
Partial persistence can achieve constant worst-case slowdown, while the corresponding full-persistence question is open
- C
Confluent persistence always has constant worst-case overhead
- D
Full persistence is deamortized, while partial persistence requires linear-time updates
Correct answer
BPartial persistence can achieve constant worst-case slowdown, while the corresponding full-persistence question is open
Explanation
The content states that partial persistence can be deamortized to constant worst-case slowdown. It identifies the corresponding result for full persistence as an open problem.
- A
- 41
How can repeated self-concatenation affect the size of a confluent data structure?
- A
It increases the size only logarithmically, regardless of the operation
- B
It can double the structure's size per update, producing size exponential in the number of updates
- C
It reduces the structure's size by one element per update
- D
It keeps the size fixed because old versions are destroyed
Correct answer
BIt can double the structure's size per update, producing size exponential in the number of updates
Explanation
If an operation concatenates a version with itself, each such update can double the number of elements. Repeating this for u updates can produce size on the order of 2u.
- A
- 42
Which sequence of operations illustrates copying and pasting using confluent persistence?
- A
Sort the string and then delete every version except the sorted one
- B
Replace every character with a pointer to the root node
- C
Query a string without creating or combining any versions
- D
Split a string into pieces and concatenate selected pieces in a new order
Correct answer
DSplit a string into pieces and concatenate selected pieces in a new order
Explanation
Splitting and concatenating versions can reconstruct, duplicate, or rearrange pieces of a string, providing a data-structure interpretation of copy-and-paste operations.
- A
- 43
What does effective depth measure in the general confluent-persistence analysis?
- A
The number of fields stored in the root node
- B
The number of queries that precede an update
- C
The logarithm of the number of paths to a version when shared history is conceptually expanded into a tree
- D
The maximum number of characters in any stored string
Correct answer
CThe logarithm of the number of paths to a version when shared history is conceptually expanded into a tree
Explanation
Effective depth is defined using the number of paths in an expanded version-history tree: it is the logarithm of the number of paths leading to the version.
- A
- 44
Why can a general confluent-persistence overhead become linear in the number of updates?
- A
The version history must contain a cycle after each merge
- B
Repeated merging can create exponentially many paths, whose logarithm is linear in the number of updates
- C
Queries are required to copy the entire structure
- D
Every update must scan every integer in the data structure
Correct answer
BRepeated merging can create exponentially many paths, whose logarithm is linear in the number of updates
Explanation
Repeated self-merging can create exponentially many paths through the version history. The logarithm of an exponential number of paths grows linearly with the number of updates, so effective-depth-based overhead can be linear.
- A
- 45
Why might a linear factor of overhead still be an improvement when self-concatenation creates exponential-size data?
- A
The result can be stored in no space once it has been constructed
- B
A linear factor makes every operation constant-time regardless of the input
- C
Explicitly constructing the exponentially large result already requires exponential work
- D
The data structure is actually constant-sized after every update
Correct answer
CExplicitly constructing the exponentially large result already requires exponential work
Explanation
If the represented result itself has exponential size, explicitly building it requires exponential time. A linear-in-the-number-of-updates overhead can still be much smaller than that explicit construction cost.
- A
- 46
What does the stated lower bound for general confluent persistence concern?
- A
No confluent data structure can support concatenation
- B
Every confluent data structure requires exponential space for every operation
- C
Every query must take at least as long as a complete data-structure rebuild
- D
A particular data structure can require space proportional to effective depth, and hence corresponding update overhead if queries are free
Correct answer
DA particular data structure can require space proportional to effective depth, and hence corresponding update overhead if queries are free
Explanation
The lower bound applies to a specific construction, not all data structures. It shows a space requirement proportional to effective depth; if queries are treated as free, this can force corresponding overhead to be charged to updates.
- A
- 47
What restriction defines the disjoint case for confluent operations?
- A
The two input versions must have no nodes in common
- B
The two input versions must have identical node sets
- C
The operation may combine only a version with itself
- D
The operation may not reorder any data
Correct answer
AThe two input versions must have no nodes in common
Explanation
In the disjoint case, a confluent operation is performed only on two versions that share no nodes. This excludes self-merging behavior that would reuse the same nodes.
- A
- 48
What overhead is stated for the disjoint case?
- A
Exponential overhead in the number of operations
- B
Order-logarithmic overhead in the number of operations
- C
Constant overhead for every unrestricted confluent operation
- D
Linear overhead in the size of every version
Correct answer
BOrder-logarithmic overhead in the number of operations
Explanation
Under the disjointness restriction, the content describes an overhead of order logn, where n can represent the number of operations.
- A
- 49
Why does the version history associated with a single node form a tree in the disjoint case?
- A
Every version containing that node must be the latest version
- B
The node is copied into every version, so histories cannot branch
- C
Versions containing that node cannot be merged with another version that also contains it
- D
The disjoint-case restriction forbids all updates
Correct answer
CVersions containing that node cannot be merged with another version that also contains it
Explanation
If two versions containing the same node cannot be combined, the node's history cannot be joined back together through a confluent operation. Its appearances therefore have a tree-shaped history.
- A
- 50
In the disjoint-case method, how can a field value be obtained when the requested version is exactly where the node changed?
- A
Search every version in the entire DAG
- B
Rebuild the node using all later modifications
- C
Combine the version with the root version
- D
Read the value recorded at that change
Correct answer
DRead the value recorded at that change
Explanation
If the requested version is one where the node changed, the relevant field value is stored directly at that change.
- A
- 51
What technique is used to find an earlier change when a version lies between two changes to a node?
- A
Path copying
- B
Link-cut trees
- C
Hashing
- D
Fractional cascading
Correct answer
BLink-cut trees
Explanation
The content describes using link-cut trees to find the previous version in which the node changed when the requested version lies between changes.
- A
- 52
What technique is identified for handling the more difficult case in which the requested version lies in a subtree after the node's history branches or the node disappears?
- A
Integer priority queues
- B
Back-pointer deletion
- C
Fractional cascading
- D
Red-black tree rotations
Correct answer
CFractional cascading
Explanation
The content identifies fractional cascading as a technique needed for the more complicated subtree case in the disjoint-case approach.
- A
- 53
How does path copying make balanced binary search trees functional?
- A
It removes parent pointers by merging all nodes into one
- B
It copies every node in the tree after each query
- C
It copies each changed node and its ancestors while leaving the original nodes unchanged
- D
It modifies nodes in place but saves a copy of the root
Correct answer
CIt copies each changed node and its ancestors while leaving the original nodes unchanged
Explanation
A functional balanced search tree can copy the nodes changed along a search path and their ancestors. Since the path is logarithmic in the tree size, the update uses logarithmically many copies.
- A
- 54
Why does a top-down balanced-tree implementation help with functional path copying?
- A
It allows old versions to be overwritten safely
- B
It makes the tree unbalanced so updates require fewer comparisons
- C
It guarantees that no node ever needs to be copied
- D
It avoids relying on parent pointers while traversing and rebuilding the changed path
Correct answer
DIt avoids relying on parent pointers while traversing and rebuilding the changed path
Explanation
The described technique implements the tree top down and does not follow parent pointers. This supports copying the relevant path and its ancestors without modifying old nodes.
- A
- 55
What update time does path copying provide for a balanced binary search tree with n items?
- A
Constant time, because no node is ever visited
- B
Linear time, because every node must be copied
- C
Exponential time, because every old version must be reconstructed
- D
Logarithmic time, because only a root-to-leaf path and its ancestors need copying
Correct answer
DLogarithmic time, because only a root-to-leaf path and its ancestors need copying
Explanation
A balanced search tree has logarithmic height, so copying the changed nodes and their ancestors takes O(logn) time.
- A
- 56
Which operations are supported by the deque example in the content?
- A
Updates only at the middle, with no concatenation
- B
Insertion only at the front and deletion only at the rear
- C
Insertion and deletion at both ends, as well as concatenation
- D
Search by arbitrary key, but no endpoint operations
Correct answer
CInsertion and deletion at both ends, as well as concatenation
Explanation
A deque supports insertion and deletion at either end. The content also notes that deques can be concatenated in constant time per operation in the functional setting described.
- A
- 57
Which operation is identified as a harder open problem for lists?
- A
Creating an empty list
- B
Inserting one item at the front
- C
Reading the first item in constant time
- D
Supporting both split and concatenation in constant time
Correct answer
DSupporting both split and concatenation in constant time
Explanation
The content identifies constant-time split together with concatenation for lists as an open problem, and describes split as harder than the deque operations discussed.
- A
- 58
What is a trie described as in the content?
- A
A tree with a fixed topology, comparable to a directory tree
- B
A graph in which every edge is deleted after a query
- C
A binary search tree that stores only historical versions
- D
A linked list whose nodes have no fixed relationships
Correct answer
AA tree with a fixed topology, comparable to a directory tree
Explanation
A trie is presented as a tree with a fixed topology, with a directory tree serving as an intuitive analogy.
- A
- 59
How does the versioning example involving a directory-like structure support confluent persistence?
- A
A subtree can be copied only if all versions are identical
- B
Every directory change must destroy all previous versions
- C
Only the root directory can be queried
- D
A subtree can be copied from one version and placed into another version
Correct answer
DA subtree can be copied from one version and placed into another version
Explanation
Copying a subtree from one version into another combines information from versions and creates a version history that can be represented as a DAG.
- A
- 60
What worst-case separation between functional and ordinary data structures is stated in the content?
- A
A logarithmic factor
- B
An exponential factor
- C
A factor of zero
- D
A constant factor
Correct answer
AA logarithmic factor
Explanation
The content states that the largest known separation between functional and ordinary data structures is a logarithmic factor.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.