Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/Python
/ functions
Functions
3,909 in github.com/TheAlgorithms/Python
⨍
Functions
3,909
◇
Types & classes
310
↳
Endpoints
2
Method
__init__
(self)
data_structures/queues/priority_queue_using_list.py:69
Method
__init__
(self)
data_structures/queues/priority_queue_using_list.py:149
Method
__init__
(self, initial_capacity: int = 6)
data_structures/queues/circular_queue_linked_list.py:22
Method
__init__
(self)
data_structures/queues/circular_queue_linked_list.py:152
Method
__init__
(self, n: int)
data_structures/queues/circular_queue.py:7
Method
__init__
>>> QueueByTwoStacks() Queue(()) >>> QueueByTwoStacks([10, 20, 30]) Queue((10, 20, 30)) >>> QueueByTwoStacks(
data_structures/queues/queue_by_two_stacks.py:7
Method
__init__
>>> QueueByList() Queue(()) >>> QueueByList([10, 20, 30]) Queue((10, 20, 30)) >>> QueueByList((i**2 for i in
data_structures/queues/queue_by_list.py:7
Method
__init__
(self, cur: Deque._Node | None)
data_structures/queues/double_ended_queue.py:60
Method
__init__
(self, iterable: Iterable[Any] | None = None)
data_structures/queues/double_ended_queue.py:89
Method
__init__
(self)
data_structures/queues/queue_on_pseudo_stack.py:7
Method
__init__
Initializes a suffix tree node. Parameters: children (dict[str, SuffixTreeNode] | None): The children of this node.
data_structures/suffix_tree/suffix_tree_node.py:13
Method
__init__
Initializes the suffix tree with the given text. Args: text (str): The text for which the suffix tree is to be built.
data_structures/suffix_tree/suffix_tree.py:13
Method
__init__
(self, data: Any)
data_structures/linked_list/has_loop.py:11
Method
__init__
(self, ints: Iterable[int])
data_structures/linked_list/merge_two_lists.py:21
Method
__init__
(self, link_p, element, link_n)
data_structures/linked_list/deque_doubly.py:17
Method
__init__
(self)
data_structures/linked_list/deque_doubly.py:27
Method
__init__
(self, item: Any, next: Any)
data_structures/linked_list/__init__.py:15
Method
__init__
(self)
data_structures/linked_list/__init__.py:21
Method
__init__
(self, head)
data_structures/linked_list/doubly_linked_list_two.py:29
Method
__init__
(self, key: KT | str = "root", value: VT | None = None)
data_structures/linked_list/skip_list.py:17
Method
__init__
(self, p: float = 0.5, max_level: int = 16)
data_structures/linked_list/skip_list.py:53
Method
__init__
(self, data=None)
data_structures/linked_list/from_sequence.py:8
Method
__init__
(self, data)
data_structures/linked_list/doubly_linked_list.py:7
Method
__init__
(self)
data_structures/linked_list/doubly_linked_list.py:17
Method
__init__
(self, ints: Iterable[int])
data_structures/linked_list/reverse_k_group.py:14
Method
__init__
(self, data: int)
data_structures/linked_list/middle_element_of_linked_list.py:5
Method
__init__
(self)
data_structures/linked_list/middle_element_of_linked_list.py:11
Method
__init__
Create and initialize LinkedList class instance. >>> linked_list = LinkedList() >>> linked_list.head is None True
data_structures/linked_list/singly_linked_list.py:41
Method
__init__
Initialize a LinkedList with the head node set to None. >>> linked_list = LinkedList() >>> (linked_list.head, linked_list.tail)
data_structures/linked_list/print_reverse.py:18
Method
__init__
Initializes a KDNode with the given point and child nodes. Args: point (list[float]): The point stored in this node.
data_structures/kd_tree/kd_node.py:22
Method
__init__
(self, val)
data_structures/heap/binomial_heap.py:15
Method
__init__
(self, bottom_root=None, min_node=None, heap_size=0)
data_structures/heap/binomial_heap.py:126
Method
__init__
(self, value: T)
data_structures/heap/skew_heap.py:17
Method
__init__
>>> sh = SkewHeap([3, 1, 3, 7]) >>> list(sh) [1, 3, 3, 7]
data_structures/heap/skew_heap.py:114
Method
__init__
(self)
data_structures/heap/max_heap.py:19
Method
__init__
(self, key: Callable | None = None)
data_structures/heap/heap_generic.py:10
Method
__init__
(self, name, val)
data_structures/heap/min_heap.py:6
Method
__init__
(self, array)
data_structures/heap/min_heap.py:34
Method
__init__
(self, value: T)
data_structures/heap/randomized_heap.py:18
Method
__init__
>>> rh = RandomizedHeap([3, 1, 3, 7]) >>> rh.to_sorted_list() [1, 3, 3, 7]
data_structures/heap/randomized_heap.py:99
Method
__init__
(self)
data_structures/heap/heap.py:48
Method
__init__
(self)
data_structures/binary_tree/avl_tree.py:17
Method
__init__
(self, data: Any)
data_structures/binary_tree/avl_tree.py:44
Method
__init__
(self)
data_structures/binary_tree/avl_tree.py:279
Method
__init__
Constructor for the Fenwick tree Parameters: arr (list): list of elements to initialize the tree with (optional)
data_structures/binary_tree/fenwick_tree.py:11
Method
__init__
(self, value: int)
data_structures/binary_tree/binary_tree_path_sum.py:18
Method
__init__
(self)
data_structures/binary_tree/binary_tree_path_sum.py:77
Method
__init__
(self, start, end, val, left=None, right=None)
data_structures/binary_tree/segment_tree_other.py:12
Method
__init__
(self, collection: Sequence, function)
data_structures/binary_tree/segment_tree_other.py:130
Method
__init__
(self, length: int)
data_structures/binary_tree/wavelet_tree.py:17
Method
__init__
Segment Tree constructor, it works just with commutative combiner. :param arr: list of elements for the segment tree :param f
data_structures/binary_tree/non_recursive_segment_tree.py:48
Method
__init__
(self, a)
data_structures/binary_tree/segment_tree.py:5
Method
__init__
(self, data: int)
data_structures/binary_tree/inorder_tree_traversal_2022.py:11
Method
__init__
(self, label: int, parent: Node | None)
data_structures/binary_tree/binary_search_tree_recursive.py:20
Method
__init__
(self)
data_structures/binary_tree/binary_search_tree_recursive.py:28
Method
__init__
(self, value: int = 0)
data_structures/binary_tree/merge_two_binary_trees.py:17
Method
__init__
(self, value: int)
data_structures/binary_tree/binary_tree_node_sum.py:21
Method
__init__
(self, tree: Node)
data_structures/binary_tree/binary_tree_node_sum.py:58
Method
__init__
Initialize a new Red-Black Tree node with the given values: label: The value associated with this node color: 0 if black, 1 if red
data_structures/binary_tree/red_black_tree.py:20
Method
__init__
Create empty Maximum Fenwick Tree with specified size Parameters: size: size of Array Returns: None
data_structures/binary_tree/maximum_fenwick_tree.py:39
Method
__init__
(self, data: int)
data_structures/binary_tree/flatten_binarytree_to_linkedlist.py:23
Method
__init__
(self, size: int)
data_structures/binary_tree/lazy_segment_tree.py:7
Method
__init__
(self, value: int | None = None)
data_structures/binary_tree/treap.py:12
Method
__init__
Initialize with a list of the number of items in each set and with rank = 1 for each set
data_structures/disjoint_set/alternate_disjoint_set.py:8
Method
__init__
(self, data: int)
data_structures/disjoint_set/disjoint_set.py:8
Method
__init__
(self, *args, **kwargs)
data_structures/hashing/hash_table_with_linked_list.py:7
Method
__init__
(self, size: int = 8)
data_structures/hashing/bloom_filter.py:68
Method
__init__
(self)
data_structures/hashing/hash_map.py:26
Method
__init__
( self, size_table: int, charge_factor: int | None = None, lim_charge: float |
data_structures/hashing/hash_table.py:12
Method
__init__
(self, *args, **kwargs)
data_structures/hashing/double_hash.py:24
Method
__init__
(self, *args, **kwargs)
data_structures/hashing/quadratic_probing.py:11
Method
__init__
(self, prefix: str = "", is_leaf: bool = False)
data_structures/trie/radix_tree.py:9
Method
__init__
(self)
data_structures/trie/trie.py:10
Method
__init__
(self, limit: int = 10)
data_structures/stacks/stack.py:25
Method
__init__
(self, data: T)
data_structures/stacks/stack_with_singly_linked_list.py:12
Method
__init__
(self)
data_structures/stacks/stack_with_singly_linked_list.py:50
Method
__init__
(self, data: T)
data_structures/stacks/stack_with_doubly_linked_list.py:12
Method
__init__
(self)
data_structures/stacks/stack_with_doubly_linked_list.py:44
Method
__init__
(self, key: T | None, val: U | None)
other/lru_cache.py:18
Method
__init__
(self)
other/lru_cache.py:98
Method
__init__
(self, capacity: int)
other/lru_cache.py:212
Method
__init__
(self, key: T | None, val: U | None)
other/lfu_cache.py:19
Method
__init__
(self)
other/lfu_cache.py:100
Method
__init__
(self, capacity: int)
other/lfu_cache.py:199
Method
__init__
Represent the literals and an assignment in a clause."
other/davis_putnam_logemann_loveland.py:34
Method
__init__
Represent the number of clauses and the clauses themselves.
other/davis_putnam_logemann_loveland.py:107
Method
__init__
(self)
other/number_container_system.py:13
Method
__init__
These parameters are saved and used when nextNumber() is called. modulo is the largest number that can be generated (exclusive). The
other/linear_congruential_generator.py:17
Method
__init__
(self, name, value, weight)
other/greedy.py:2
Method
__init__
(self, words: list[str], width: int, height: int)
other/word_search.py:28
Method
__init__
Creates an empty store and map for the keys. The LRUCache is set the size n.
other/least_recently_used.py:37
Method
__init__
:param claim_vector: A nxn/nxm list depicting the amount of each resources (eg. memory, interface, semaphores, etc.) available.
other/bankers_algorithm.py:41
Method
__init__
(self, rows: list[list[int]])
matrix/matrix_class.py:110
Method
__init__
(self, row: int, col: int, graph: list[list[bool]])
matrix/count_islands_in_matrix.py:7
Method
__init__
<method Matrix.__init__> Initialize matrix with given size and default value. Example: >>> a = Matrix(2, 3, 1)
matrix/sherman_morrison.py:12
Method
__init__
(self, group: int = 14)
ciphers/diffie_hellman.py:214
Method
__init__
(self)
ciphers/bifid.py:22
Method
__init__
(self)
ciphers/polybius.py:21
Method
__init__
simple constructor that receives a key or uses default key = 0
ciphers/xor_cipher.py:24
Method
__init__
encrypt_key is an NxN numpy array
ciphers/hill_cipher.py:56
← previous
next →
2,501–2,600 of 3,909, ranked by callers