1. Home
  2. Explore
  3. Computer Science
  4. Temporal Data Structures

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Temporal Data Structures

  • 60Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Advanced Data Structures

What is the central goal of succinct data structures?

60 questions

  1. 1

    What is the central goal of succinct data structures?

    1. A

      To store information using close to the minimum number of bits implied by the number of possible states

    2. B

      To reduce every query to constant time by duplicating the stored information

    3. C

      To make data structures efficient only when their contents are strings

    4. D

      To represent all data using pointers rather than integer values

    Correct answer
    A

    To store information using close to the minimum number of bits implied by the number of possible states

    Explanation

    If there are 2n2^n2n possible states, distinguishing among them requires at least nnn bits. Succinct data structures aim to approach that minimum, perhaps with only a small additional space cost.

  2. 2

    Why can algorithms sometimes perform better when they know their keys are integers rather than arbitrary objects?

    1. A

      Arbitrary objects cannot be stored in pointer-machine data structures

    2. B

      Integer keys always arrive in sorted order, eliminating the need for updates

    3. C

      Integer representations can support operations beyond comparisons, enabling faster data structures

    4. D

      Integer keys make the number of stored items independent of the input size

    Correct answer
    C

    Integer 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.

  3. 3

    Which problem best illustrates the dynamic-graph setting described in the content?

    1. A

      Sorting a static set of integer keys once

    2. B

      Choosing a cache size before any data is processed

    3. C

      Maintaining information about a social network as friendships are added and removed

    4. D

      Finding a fixed substring in an unchanging text document

    Correct answer
    C

    Maintaining 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.

  4. 4

    What is the main computational challenge in searching for a substring in a large text or DNA sequence?

    1. A

      Keeping every historical version of a priority queue

    2. B

      Maintaining a graph while its vertices are repeatedly deleted

    3. C

      Reducing the number of dimensions in a geometric data set

    4. D

      Finding occurrences of a pattern efficiently within a potentially very large string

    Correct answer
    D

    Finding 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.

  5. 5

    What does the memory-hierarchy model represent?

    1. A

      A graph whose vertices are ordered by the number of times they have been updated

    2. B

      A tree in which each node stores every possible integer key

    3. C

      A computer with several levels of storage, such as cache and main memory, whose differing costs affect optimization

    4. D

      A data structure that stores only the most recent version of a string

    Correct answer
    C

    A 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.

  6. 6

    Which question captures the dynamic-optimality topic introduced in the content?

    1. A

      Whether a graph can be updated without representing its edges

    2. B

      Whether a linked list can store more than one pointer per node

    3. C

      Whether there is one binary search tree that is best for all relevant operations

    4. D

      Whether every string can be encoded using exactly one bit

    Correct answer
    C

    Whether 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.

  7. 7

    Which statement best describes the role of hashing in the course overview?

    1. A

      It is presented as a widely used and prominent data-structure technique

    2. B

      It is presented as a technique that applies only to historical versions

    3. C

      It is presented as a replacement for all forms of memory

    4. D

      It is presented as a method used only for geometric data

    Correct answer
    A

    It 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.

  8. 8

    What distinction motivates studying higher-dimensional data structures in geometry?

    1. A

      Higher-dimensional data can only be queried in historical versions

    2. B

      Geometric data must be stored without any nodes or pointers

    3. C

      Geometric data always consists of arbitrary objects that cannot be compared

    4. D

      Geometric data may have more than one dimension, unlike data structures restricted to one dimension

    Correct answer
    D

    Geometric 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.

  9. 9

    What is the basic organization of memory in a pointer machine?

    1. A

      A fixed sequence of bits with no references between locations

    2. B

      A collection of nodes, each with a constant number of fields

    3. C

      A tree whose nodes may have an unbounded number of fields

    4. D

      A single unlimited array containing every possible data value

    Correct answer
    B

    A 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.

  10. 10

    Which value is permitted in a pointer-machine field under the model described?

    1. A

      An arbitrary-length list of pointers

    2. B

      Only an integer, never a pointer

    3. C

      A pointer to another node, a null pointer, or a data item

    4. D

      Only a pointer to the root node

    Correct answer
    C

    A 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.

  11. 11

    What role does the root node play in the pointer-machine model?

    1. A

      It provides a fixed starting point from which nodes can be reached by following pointers

    2. B

      It prevents the data structure from containing cycles

    3. C

      It stores every data item directly, so other nodes are unnecessary

    4. D

      It changes whenever any field in any node is modified

    Correct answer
    A

    It 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.

  12. 12

    Which operation is allowed in the pointer-machine model?

    1. A

      Creating a node and reading or setting its fields

    2. B

      Accessing any memory location by an unrestricted numerical address

    3. C

      Reaching any node without following a pointer

    4. D

      Using an arbitrarily large array as a primitive operation

    Correct answer
    A

    Creating 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.

  13. 13

    Why is a constant bound on the number of pointers into each node important for the partial-persistence transformation?

    1. A

      It ensures that all versions form a linear sequence

    2. B

      It guarantees that every node contains exactly one field

    3. C

      It eliminates the need to store any modifications

    4. D

      It bounds the number of incoming references that may need to be found and updated when a node is copied

    Correct answer
    D

    It 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.

  14. 14

    What are back pointers used for in the persistence technique?

    1. A

      They record the chronological order of every query

    2. B

      They record which nodes point to a given node, making those references locatable

    3. C

      They connect each version directly to every other version

    4. D

      They store copies of all data items ever inserted

    Correct answer
    B

    They 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.

  15. 15

    Why are arrays not part of the pointer-machine model described?

    1. A

      Arrays prevent nodes from having a constant number of fields

    2. B

      The model organizes access through nodes and pointers rather than unrestricted indexed storage

    3. C

      Arrays cannot store integers

    4. D

      Arrays would force every version to be destroyed after an update

    Correct answer
    B

    The 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.

  16. 16

    What does persistence require of an update operation?

    1. A

      It modifies only a query result and never changes the data structure

    2. B

      It changes every existing version to match the newest state

    3. C

      It acts relative to a specified version and produces a new version without erasing old ones

    4. D

      It permanently deletes all versions older than the one being updated

    Correct answer
    C

    It 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.

  17. 17

    What distinguishes partial persistence from full persistence?

    1. A

      Partial persistence never stores updates, while full persistence stores only queries

    2. B

      Partial persistence permits queries only on the latest version, while full persistence forbids queries

    3. C

      Partial persistence combines versions, while full persistence deletes them

    4. D

      Partial persistence permits updates only to the latest version, while full persistence permits updates to any version

    Correct answer
    D

    Partial 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.

  18. 18

    What is the shape of the version history in partial persistence?

    1. A

      A directed acyclic graph, because versions can be merged

    2. B

      A tree, because any historical version can branch

    3. C

      A cycle, because updates can return to earlier versions

    4. D

      A line, because each new version extends the latest one

    Correct answer
    D

    A 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.

  19. 19

    What is the shape of the version history in full persistence?

    1. A

      A cycle, because each update points back to its parent

    2. B

      A directed acyclic graph, because any two versions must be merged

    3. C

      A line, because only the latest version can be updated

    4. D

      A tree, because updating an older version creates a new branch

    Correct answer
    D

    A 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.

  20. 20

    What extra capability defines confluent persistence?

    1. A

      Changing nodes in place without retaining old versions

    2. B

      Querying versions only when they form a single line

    3. C

      Updating only the latest version and discarding the rest

    4. D

      Combining two versions to create a new version

    Correct answer
    D

    Combining two versions to create a new version

    Explanation

    Confluent persistence permits combining two versions into a new version, in addition to retaining old versions.

  21. 21

    Why do versions form a directed acyclic graph under confluent persistence?

    1. A

      All old versions are replaced by a single merged version

    2. B

      Updates are allowed only on the newest version

    3. C

      Every version must have exactly one predecessor and one successor

    4. D

      A version may be formed from two earlier versions, creating multiple incoming histories without cycles

    Correct answer
    D

    A 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.

  22. 22

    Which statement best distinguishes functional data structures from the other persistence levels?

    1. A

      They permit updates only to a single latest version

    2. B

      They never modify nodes; changes are represented by creating new nodes

    3. C

      They require every version to be combined with every other version

    4. D

      They allow old nodes to be changed whenever a version is queried

    Correct answer
    B

    They 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.

  23. 23

    Why can functional data structures provide persistence levels without extra version-destruction concerns?

    1. A

      Because never destroying or modifying nodes also prevents the destruction of represented versions

    2. B

      Because they do not support update operations

    3. C

      Because their versions always form a line

    4. D

      Because functional structures store only one version at a time

    Correct answer
    A

    Because 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.

  24. 24

    How are modifications represented in the partial-persistence method?

    1. A

      As complete copies of the entire data structure after every update

    2. B

      As records containing the version, the changed field, and the new value

    3. C

      As pointers from every version to every field in the structure

    4. D

      As queries stored without any associated version

    Correct answer
    B

    As 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.

  25. 25

    How does the method read a field for a requested version?

    1. A

      It scans every node in every version and selects the most common value

    2. B

      It reads the field from the newest version, regardless of the requested version

    3. C

      It starts from the node's original field value and applies the latest relevant recorded modification

    4. D

      It reconstructs the entire history by copying all earlier data structures

    Correct answer
    C

    It 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.

  26. 26

    What happens when a node has room in its modification area and one of its fields changes?

    1. A

      A modification record is added for that field and value

    2. B

      Every earlier version is changed to contain the new value

    3. C

      The node is deleted and replaced by a root node

    4. D

      The entire data structure is copied immediately

    Correct answer
    A

    A 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.

  27. 27

    What does the partial-persistence method do when a node's modification area is full?

    1. A

      It creates a replacement node representing the latest state and retains the old node for earlier versions

    2. B

      It stores the update in every node in the data structure

    3. C

      It deletes the node and all versions that refer to it

    4. D

      It stops accepting updates until all old versions are queried

    Correct answer
    A

    It 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.

  28. 28

    After creating a replacement node in partial persistence, what must happen to current references to the old node?

    1. A

      They must be redirected to the root regardless of their destination

    2. B

      They must be left unchanged in every version

    3. C

      They must be redirected to the replacement, while references needed by old versions remain valid

    4. D

      They must all be deleted, including references used by old versions

    Correct answer
    C

    They 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.

  29. 29

    Why can updating references to a copied node require recursive operations?

    1. A

      A pointer machine cannot represent a pointer to a new node

    2. B

      Changing a pointer is itself a field modification that may need to be recorded persistently

    3. C

      Recursive updates are required only to change integer data values

    4. D

      Every pointer update requires rebuilding the entire version history

    Correct answer
    B

    Changing 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.

  30. 30

    What does the potential argument for partial persistence use to pay for expensive node copying?

    1. A

      The total number of data items in the input

    2. B

      The number of versions that have never been updated

    3. C

      The decrease in stored modifications when a full node is replaced by a fresh one

    4. D

      The number of queries performed on the oldest version

    Correct answer
    C

    The 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.

  31. 31

    What performance guarantee is stated for the bounded-degree partial-persistence transformation?

    1. A

      Linear overhead per query and constant space per stored version

    2. B

      Logarithmic overhead per operation and space proportional to all possible states

    3. C

      Constant amortized-factor overhead and constant additional space per change

    4. D

      Constant worst-case time for all operations and no additional space

    Correct answer
    C

    Constant 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.

  32. 32

    Why can the simple partial-persistence copying strategy fail for full persistence?

    1. A

      Full persistence allows queries only on the latest version

    2. B

      Full persistence does not allow nodes to store modifications

    3. C

      An older, full node can be updated repeatedly, causing the same expensive copying work again and again

    4. D

      An older node cannot have any incoming pointers

    Correct answer
    C

    An 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.

  33. 33

    How does the full-persistence method handle a full node differently from the partial-persistence method?

    1. A

      It discards all modifications and treats every version as identical

    2. B

      It copies the entire structure but leaves the full node unchanged

    3. C

      It forbids further updates to that version

    4. D

      It splits the modifications into portions so the original node also has room for future updates

    Correct answer
    D

    It 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.

  34. 34

    Why is splitting a node's modifications in full persistence more complicated than dividing a list in half?

    1. A

      Each modification must be assigned to every version in the DAG

    2. B

      The node's fields cannot contain pointers

    3. C

      The modifications are stored in an array that cannot be divided

    4. D

      The modifications correspond to a branching tree of versions that must be partitioned into suitable subtrees

    Correct answer
    D

    The 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.

  35. 35

    What is the purpose of representing a version-tree node by a beginning marker and an ending marker in a traversal order?

    1. A

      It guarantees that the version tree has no branches

    2. B

      It stores the values of all fields changed in that version

    3. C

      It replaces all pointers between data-structure nodes

    4. D

      It makes ancestor relationships detectable through the nesting order of the markers

    Correct answer
    D

    It 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.

  36. 36

    What operations does the order-maintenance structure support in the full-persistence construction?

    1. A

      Finding the integer stored at any address without following pointers

    2. B

      Merging arbitrary data structures and deleting every historical version

    3. C

      Inserting an item next to a given item and comparing the relative order of two items

    4. D

      Converting every version tree into a balanced search tree

    Correct answer
    C

    Inserting 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.

  37. 37

    How does the marker ordering help decide whether a modification applies to a requested version?

    1. A

      The modification applies when its version is an ancestor of the requested version

    2. B

      The modification applies whenever its marker is later than the requested version's ending marker

    3. C

      The modification applies only when its version is the latest version

    4. D

      The modification applies only if the two versions are on separate branches

    Correct answer
    A

    The 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.

  38. 38

    Why must back pointers be maintained across all versions in full persistence?

    1. A

      Any version may be updated, so references in historical branches can matter to later operations

    2. B

      Full persistence permits queries only through back pointers

    3. C

      The version tree cannot be traversed without storing all pointers twice

    4. D

      Every node has exactly one incoming pointer in every version

    Correct answer
    A

    Any 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.

  39. 39

    What kind of overhead is guaranteed by the described full-persistence transformation for bounded-degree pointer machines?

    1. A

      Logarithmic worst-case overhead for every query

    2. B

      Constant amortized overhead

    3. C

      Linear overhead in the number of versions

    4. D

      Constant worst-case overhead for every operation

    Correct answer
    B

    Constant 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.

  40. 40

    What does the described deamortization result establish?

    1. A

      Both partial and full persistence achieve zero overhead in every operation

    2. B

      Partial persistence can achieve constant worst-case slowdown, while the corresponding full-persistence question is open

    3. C

      Confluent persistence always has constant worst-case overhead

    4. D

      Full persistence is deamortized, while partial persistence requires linear-time updates

    Correct answer
    B

    Partial 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.

  41. 41

    How can repeated self-concatenation affect the size of a confluent data structure?

    1. A

      It increases the size only logarithmically, regardless of the operation

    2. B

      It can double the structure's size per update, producing size exponential in the number of updates

    3. C

      It reduces the structure's size by one element per update

    4. D

      It keeps the size fixed because old versions are destroyed

    Correct answer
    B

    It 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 uuu updates can produce size on the order of 2u2^u2u.

  42. 42

    Which sequence of operations illustrates copying and pasting using confluent persistence?

    1. A

      Sort the string and then delete every version except the sorted one

    2. B

      Replace every character with a pointer to the root node

    3. C

      Query a string without creating or combining any versions

    4. D

      Split a string into pieces and concatenate selected pieces in a new order

    Correct answer
    D

    Split 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.

  43. 43

    What does effective depth measure in the general confluent-persistence analysis?

    1. A

      The number of fields stored in the root node

    2. B

      The number of queries that precede an update

    3. C

      The logarithm of the number of paths to a version when shared history is conceptually expanded into a tree

    4. D

      The maximum number of characters in any stored string

    Correct answer
    C

    The 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.

  44. 44

    Why can a general confluent-persistence overhead become linear in the number of updates?

    1. A

      The version history must contain a cycle after each merge

    2. B

      Repeated merging can create exponentially many paths, whose logarithm is linear in the number of updates

    3. C

      Queries are required to copy the entire structure

    4. D

      Every update must scan every integer in the data structure

    Correct answer
    B

    Repeated 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.

  45. 45

    Why might a linear factor of overhead still be an improvement when self-concatenation creates exponential-size data?

    1. A

      The result can be stored in no space once it has been constructed

    2. B

      A linear factor makes every operation constant-time regardless of the input

    3. C

      Explicitly constructing the exponentially large result already requires exponential work

    4. D

      The data structure is actually constant-sized after every update

    Correct answer
    C

    Explicitly 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.

  46. 46

    What does the stated lower bound for general confluent persistence concern?

    1. A

      No confluent data structure can support concatenation

    2. B

      Every confluent data structure requires exponential space for every operation

    3. C

      Every query must take at least as long as a complete data-structure rebuild

    4. D

      A particular data structure can require space proportional to effective depth, and hence corresponding update overhead if queries are free

    Correct answer
    D

    A 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.

  47. 47

    What restriction defines the disjoint case for confluent operations?

    1. A

      The two input versions must have no nodes in common

    2. B

      The two input versions must have identical node sets

    3. C

      The operation may combine only a version with itself

    4. D

      The operation may not reorder any data

    Correct answer
    A

    The 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.

  48. 48

    What overhead is stated for the disjoint case?

    1. A

      Exponential overhead in the number of operations

    2. B

      Order-logarithmic overhead in the number of operations

    3. C

      Constant overhead for every unrestricted confluent operation

    4. D

      Linear overhead in the size of every version

    Correct answer
    B

    Order-logarithmic overhead in the number of operations

    Explanation

    Under the disjointness restriction, the content describes an overhead of order log⁡n\log nlogn, where nnn can represent the number of operations.

  49. 49

    Why does the version history associated with a single node form a tree in the disjoint case?

    1. A

      Every version containing that node must be the latest version

    2. B

      The node is copied into every version, so histories cannot branch

    3. C

      Versions containing that node cannot be merged with another version that also contains it

    4. D

      The disjoint-case restriction forbids all updates

    Correct answer
    C

    Versions 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.

  50. 50

    In the disjoint-case method, how can a field value be obtained when the requested version is exactly where the node changed?

    1. A

      Search every version in the entire DAG

    2. B

      Rebuild the node using all later modifications

    3. C

      Combine the version with the root version

    4. D

      Read the value recorded at that change

    Correct answer
    D

    Read 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.

  51. 51

    What technique is used to find an earlier change when a version lies between two changes to a node?

    1. A

      Path copying

    2. B

      Link-cut trees

    3. C

      Hashing

    4. D

      Fractional cascading

    Correct answer
    B

    Link-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.

  52. 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?

    1. A

      Integer priority queues

    2. B

      Back-pointer deletion

    3. C

      Fractional cascading

    4. D

      Red-black tree rotations

    Correct answer
    C

    Fractional cascading

    Explanation

    The content identifies fractional cascading as a technique needed for the more complicated subtree case in the disjoint-case approach.

  53. 53

    How does path copying make balanced binary search trees functional?

    1. A

      It removes parent pointers by merging all nodes into one

    2. B

      It copies every node in the tree after each query

    3. C

      It copies each changed node and its ancestors while leaving the original nodes unchanged

    4. D

      It modifies nodes in place but saves a copy of the root

    Correct answer
    C

    It 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.

  54. 54

    Why does a top-down balanced-tree implementation help with functional path copying?

    1. A

      It allows old versions to be overwritten safely

    2. B

      It makes the tree unbalanced so updates require fewer comparisons

    3. C

      It guarantees that no node ever needs to be copied

    4. D

      It avoids relying on parent pointers while traversing and rebuilding the changed path

    Correct answer
    D

    It 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.

  55. 55

    What update time does path copying provide for a balanced binary search tree with nnn items?

    1. A

      Constant time, because no node is ever visited

    2. B

      Linear time, because every node must be copied

    3. C

      Exponential time, because every old version must be reconstructed

    4. D

      Logarithmic time, because only a root-to-leaf path and its ancestors need copying

    Correct answer
    D

    Logarithmic 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(log⁡n)O(\log n)O(logn) time.

  56. 56

    Which operations are supported by the deque example in the content?

    1. A

      Updates only at the middle, with no concatenation

    2. B

      Insertion only at the front and deletion only at the rear

    3. C

      Insertion and deletion at both ends, as well as concatenation

    4. D

      Search by arbitrary key, but no endpoint operations

    Correct answer
    C

    Insertion 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.

  57. 57

    Which operation is identified as a harder open problem for lists?

    1. A

      Creating an empty list

    2. B

      Inserting one item at the front

    3. C

      Reading the first item in constant time

    4. D

      Supporting both split and concatenation in constant time

    Correct answer
    D

    Supporting 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.

  58. 58

    What is a trie described as in the content?

    1. A

      A tree with a fixed topology, comparable to a directory tree

    2. B

      A graph in which every edge is deleted after a query

    3. C

      A binary search tree that stores only historical versions

    4. D

      A linked list whose nodes have no fixed relationships

    Correct answer
    A

    A 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.

  59. 59

    How does the versioning example involving a directory-like structure support confluent persistence?

    1. A

      A subtree can be copied only if all versions are identical

    2. B

      Every directory change must destroy all previous versions

    3. C

      Only the root directory can be queried

    4. D

      A subtree can be copied from one version and placed into another version

    Correct answer
    D

    A 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.

  60. 60

    What worst-case separation between functional and ordinary data structures is stated in the content?

    1. A

      A logarithmic factor

    2. B

      An exponential factor

    3. C

      A factor of zero

    4. D

      A constant factor

    Correct answer
    A

    A logarithmic factor

    Explanation

    The content states that the largest known separation between functional and ordinary data structures is a logarithmic factor.

Question 1 of 60
Question 1 of 60

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent