dsa.generators module — ucxdsa documentation

# dsa.generators module

dsa.generators.linear_doubly_linked_list(size, min_val=0, max_val=100)

  Generates a linear doubly linked list of integers. :param size – number of nodes in the list: :param min_val – minimum value of the nodes: :param max_val – maximum value of the nodes:

  Return type:

    `DoublyLinkedList`

  Returns:

    DoublyLinkedList

dsa.generators.linear_dynamic_queue(size, min_val=0, max_val=100)

  Generates a linear dynamic queue of integers. :param size – number of elements in the queue: :param min_val – minimum value of the elements: :param max_val – maximum value of the elements:

  Return type:

    `DynamicQueue`

  Returns:

    DynamicQueue

dsa.generators.linear_dynamic_stack(size, min_val=0, max_val=100)

  Generates a linear dynamic stack of integers. :param size – number of elements in the stack: :param min_val – minimum value of the elements: :param max_val – maximum value of the elements:

  Return type:

    `DynamicStack`

  Returns:

    DynamicStack

dsa.generators.linear_linked_list(size, min_val=0, max_val=100)

  Generates a linear linked list of integers. :param size – number of elements in the linked list: :param min_val – minimum value of the elements: :param max_val – maximum value of the elements:

  Return type:

    `LinkedList`

  Returns:

    LinkedList

dsa.generators.linear_queue(size, min_val=0, max_val=100)

  Generates a linear queue of integers. :param size – number of elements in the queue: :param min_val – minimum value of the elements: :param max_val – maximum value of the elements:

  Return type:

    `Queue`

  Returns:

    Queue

dsa.generators.linear_stack(size, min_val=0, max_val=100)

  Generates a linear stack of integers. :param size – number of elements in the stack: :param min_val – minimum value of the elements: :param max_val – maximum value of the elements:

  Return type:

    `Stack`

  Returns:

    Stack

dsa.generators.random_adjacency_list_graph(n, density=0.1, directed=False)
  Return type:

    `AdjacencyListGraph`

dsa.generators.random_adjacency_list_weighted_graph(n, density=0.1, directed=False)
  Return type:

    `AdjacencyListWeightedGraph`

dsa.generators.random_adjacency_matrix_graph(n, density=0.1, directed=False)
  Return type:

    `AdjacencyMatrixGraph`

dsa.generators.random_adjacency_matrix_weighted_graph(n, density=0.1, directed=False)
  Return type:

    `AdjacencyMatrixWeightedGraph`

dsa.generators.random_array(size, min_val=0, max_val=100)

  Generates a random array of integers. :param size – number of elements in the array: :param min_val – minimum value of the elements: :param max_val – maximum value of the elements:

  Return type:

    `Array`

  Returns:

    Array

dsa.generators.random_binary_tree(n)

  Generates a random binary tree. :param n – number of nodes in the tree:

  Return type:

    `Tree`

  Returns:

    Tree

dsa.generators.random_binary_tree_node(n)

  Generates a random binary tree with exactly n nodes. :param n – number of nodes in the tree:

  Return type:

    `TreeNode`

  Returns:

    TreeNode

dsa.generators.random_deque(size, min_val=0, max_val=100)

  Generates a random deque of integers. :param size – number of elements in the deque: :param min_val – minimum value of the elements: :param max_val – maximum value of the elements:

  Return type:

    `Deque`

  Returns:

    Deque

dsa.generators.random_doubly_linked_list(size, min_val=0, max_val=100)

  Generates a random doubly linked list of integers. :param size – number of nodes in the list: :param min_val – minimum value of the nodes: :param max_val – maximum value of the nodes:

  Return type:

    `DoublyLinkedList`

  Returns:

    DoublyLinkedList

dsa.generators.random_dynamic_queue(size, min_val=0, max_val=100)

  Generates a random dynamic queue of integers. :param size – number of elements in the queue: :param min_val – minimum value of the elements: :param max_val – maximum value of the elements:

  Return type:

    `DynamicQueue`

  Returns:

    DynamicQueue

dsa.generators.random_dynamic_stack(size, min_val=0, max_val=100)

  Generates a random dynamic stack of integers. :param size – number of elements in the stack: :param min_val – minimum value of the elements: :param max_val – maximum value of the elements:

  Return type:

    `DynamicStack`

  Returns:

    DynamicStack

dsa.generators.random_dynamicarray(size, min_val=0, max_val=100)

  Generates a random dynamic array of integers. :param size – number of elements in the array: :param min_val – minimum value of the elements: :param max_val – maximum value of the elements:

  Return type:

    `DynamicArray`

  Returns:

    DynamicArray

dsa.generators.random_heap(n)

  Generates a random heap. :param n – number of nodes in the heap:

  Return type:

    `Heap`

  Returns:

    Heap

dsa.generators.random_linked_list(size, min_val=0, max_val=100)

  Generates a random linked list of integers. :param size – number of elements in the linked list: :param min_val – minimum value of the elements: :param max_val – maximum value of the elements:

  Return type:

    `LinkedList`

  Returns:

    LinkedList

dsa.generators.random_queue(size, min_val=0, max_val=100)

  Generates a random queue of integers. :param size – number of elements in the queue: :param min_val – minimum value of the elements: :param max_val – maximum value of the elements:

  Return type:

    `Queue`

  Returns:

    Queue

dsa.generators.random_stack(size, min_val=0, max_val=100)

  Generates a random stack of integers. :param size – number of elements in the stack: :param min_val – minimum value of the elements: :param max_val – maximum value of the elements:

  Return type:

    `Stack`

  Returns:

    Stack

dsa.generators.random_trie(n)

  Generates a random trie.

  Parameters:

    trie (n -- number of words in the)

  Return type:

    `Trie`

  Returns:

    Trie