MCPcopy Create free account

hub / github.com/TheAlgorithms/Python / functions

Functions3,909 in github.com/TheAlgorithms/Python

Method__neg__
<method Matrix.__neg__> Return -self. Example: >>> a = Matrix(2, 2, 3) >>> a[0, 1] = a[1, 0] = -2 >>>
matrix/sherman_morrison.py:127
Method__new__
Executes at the creation of class object and returns if object is already created. This class follows singleton design patter
machine_learning/automatic_differentiation.py:196
Method__next__
>>> our_deque = Deque([1, 2, 3]) >>> iterator = iter(our_deque) >>> next(iterator) 1 >>>
data_structures/queues/double_ended_queue.py:70
Method__next__
(self)
data_structures/linked_list/doubly_linked_list_two.py:35
Method__post_init__
(self)
geometry/geometry.py:32
Method__post_init__
(self)
geometry/geometry.py:69
Method__post_init__
(self)
maths/numerical_analysis/adams_bashforth.py:52
Method__post_init__
>>> Node(3).neighbors []
graphs/deep_clone_graph.py:21
Method__post_init__
(self)
data_structures/binary_tree/serialize_deserialize_binary_tree.py:22
Method__pow__
(self, power: int)
machine_learning/automatic_differentiation.py:110
Method__pow__
(self, n)
maths/dual_number_automatic_differentiation.py:82
Method__pow__
(self, other: int)
matrix/matrix_class.py:340
Method__rbf
RBF: Radial Basis Function Kernel Note: for more information see: https://en.wikipedia.org/wiki/Radial_basis_function_ke
machine_learning/support_vector_machines.py:85
Method__repr__
(self)
machine_learning/frequent_pattern_growth.py:43
Method__repr__
(self)
machine_learning/sequential_minimum_optimization.py:433
Method__repr__
(self)
machine_learning/automatic_differentiation.py:59
Method__repr__
>>> token = Token(1, 2, "c") >>> repr(token) '(1, 2, c)' >>> str(token) '(1, 2, c)'
data_compression/lz77.py:48
Method__repr__
(self)
data_compression/huffman.py:12
Method__repr__
(self)
geometry/geometry.py:131
Method__repr__
(self)
geometry/jarvis_march.py:37
Method__repr__
>>> Entity(prey=True, coords=(1, 1)) Entity(prey=True, coords=(1, 1), remaining_reproduction_time=5) >>> Entity(prey=False, c
cellular_automata/wa_tor.py:77
Method__repr__
(self)
maths/dual_number_automatic_differentiation.py:19
Method__repr__
(self)
maths/pythagoras.py:12
Method__repr__
>>> p = Polynomial(2, [1, 2, 3]) >>> p 3x^2 + 2x + 1
maths/polynomials/single_indeterminate_operations.py:127
Method__repr__
(self)
graphs/minimum_spanning_tree_prims2.py:94
Method__repr__
(self)
graphs/minimum_spanning_tree_prims2.py:200
Method__repr__
(self)
graphs/page_rank.py:30
Method__repr__
(self)
graphs/graph_list.py:149
Method__repr__
(self)
graphs/graph_adjacency_matrix.py:198
Method__repr__
(self)
graphs/graph_adjacency_list.py:189
Method__repr__
Return the vertex id.
graphs/prim.py:34
Method__repr__
(self)
divide_and_conquer/convex_hull.py:81
Method__repr__
(self)
web_programming/instagram_crawler.py:59
Method__repr__
>>> queue = QueueByTwoStacks() >>> queue Queue(()) >>> str(queue) 'Queue(())' >>> queue.put(10)
data_structures/queues/queue_by_two_stacks.py:42
Method__repr__
>>> queue = QueueByList() >>> queue Queue(()) >>> str(queue) 'Queue(())' >>> queue.put(10) >>
data_structures/queues/queue_by_list.py:40
Method__repr__
Implements representation of the deque. Represents it as a list, with its values between '[' and ']'. Time complexity: O(n)
data_structures/queues/double_ended_queue.py:439
Method__repr__
Generate a string representation of the Circular Linked List. Returns: A string of the format "1->2->....->N".
data_structures/linked_list/circular_linked_list.py:38
Method__repr__
:return: Visual representation of Node >>> node = Node("Key", 2) >>> repr(node) 'Node(Key: 2)'
data_structures/linked_list/skip_list.py:22
Method__repr__
Returns a visual representation of the node and all its following nodes.
data_structures/linked_list/from_sequence.py:12
Method__repr__
Get the string representation of this node. >>> Node(10).__repr__() 'Node(10)' >>> repr(Node(10)) 'Node(10)'
data_structures/linked_list/singly_linked_list.py:25
Method__repr__
String representation/visualization of a Linked Lists >>> linked_list = LinkedList() >>> linked_list.insert_tail(1) >
data_structures/linked_list/singly_linked_list.py:90
Method__repr__
Returns a string representation of the LinkedList. >>> linked_list = LinkedList() >>> str(linked_list) '' >>> linked_l
data_structures/linked_list/print_reverse.py:40
Method__repr__
(self)
data_structures/heap/heap.py:52
Method__repr__
(self)
data_structures/binary_tree/segment_tree_other.py:20
Method__repr__
>>> node = Node(length=27) >>> repr(node) 'Node(min_value=-1 max_value=-1)' >>> repr(node) == str(node) True
data_structures/binary_tree/wavelet_tree.py:24
Method__repr__
(self)
data_structures/binary_tree/binary_search_tree.py:117
Method__repr__
(self)
data_structures/binary_tree/red_black_tree.py:487
Method__repr__
Represent the tree as a string. Returns: A string representation of the tree. >>> repr(TreeNode(1)) '1,
data_structures/binary_tree/serialize_deserialize_binary_tree.py:56
Method__repr__
(self)
data_structures/binary_tree/treap.py:18
Method__repr__
(self)
data_structures/hashing/hash_map.py:317
Method__repr__
(self)
other/lru_cache.py:24
Method__repr__
(self)
other/lru_cache.py:103
Method__repr__
Return the details for the cache instance [hits, misses, capacity, current_size]
other/lru_cache.py:220
Method__repr__
(self)
other/lfu_cache.py:26
Method__repr__
(self)
other/lfu_cache.py:105
Method__repr__
Return the details for the cache instance [hits, misses, capacity, current_size]
other/lfu_cache.py:207
Method__repr__
(self)
other/graham_scan.py:24
Method__repr__
(self)
other/greedy.py:7
Method__repr__
(self)
other/least_recently_used.py:73
Method__repr__
(self)
matrix/matrix_class.py:229
Method__repr__
(self)
matrix/sherman_morrison.py:54
Method__repr__
(self)
project_euler/problem_054/sol1.py:327
Method__setitem__
>>> linked_list = LinkedList() >>> for i in range(0, 10): ... linked_list.insert_nth(i, i) >>> linked_list[0] = 6
data_structures/linked_list/singly_linked_list.py:133
Method__setitem__
1. Changing value of item whose key is present >>> hm = HashMap(5) >>> hm._add_item(1, 10) >>> hm.__setitem__(1, 20)
data_structures/hashing/hash_map.py:177
Method__setitem__
<method Matrix.__setitem__> Set array[row][column] = value where loc = (row, column). Example: >>> a = Matrix(2, 3, 1
matrix/sherman_morrison.py:87
Method__str__
(self)
computer_vision/harris_corner.py:23
Method__str__
string representation of the current search state. >>> str(SearchProblem(0, 0, 1, None)) 'x: 0 y: 0' >>> str(SearchPr
searches/hill_climbing.py:75
Method__str__
returns a string representation of the vector
linear_algebra/src/lib.py:66
Method__str__
returns a string representation of this matrix.
linear_algebra/src/lib.py:273
Method__str__
(self)
maths/radix2_fft.py:160
Method__str__
Returns string representation of the graph
graphs/minimum_spanning_tree_boruvka.py:57
Method__str__
>>> FuzzySet("fuzzy_set", 0.1, 0.2, 0.3) FuzzySet(name='fuzzy_set', left_boundary=0.1, peak=0.2, right_boundary=0.3)
fuzzy_logic/fuzzy_operations.py:68
Method__str__
(self)
web_programming/instagram_crawler.py:62
Method__str__
(self)
data_structures/queues/linked_queue.py:14
Method__str__
>>> queue = LinkedQueue() >>> for i in range(1, 4): ... queue.put(i) >>> queue.put("Python") >>> queue.pu
data_structures/queues/linked_queue.py:70
Method__str__
(self)
data_structures/queues/priority_queue_using_list.py:99
Method__str__
Prints all the elements within the Element Priority Queue
data_structures/queues/priority_queue_using_list.py:173
Method__str__
(self)
data_structures/queues/queue_on_pseudo_stack.py:11
Method__str__
>>> str(SortedLinkedList([])) '' >>> str(SortedLinkedList(test_data_odd)) '-11 -> -1 -> 0 -> 1 -> 3 -> 5 -> 7 -> 9'
data_structures/linked_list/merge_two_lists.py:50
Method__str__
>>> linked_list = LinkedList() >>> linked_list.add(23) >>> linked_list.add(14) >>> linked_list.add(9) >>> pri
data_structures/linked_list/__init__.py:92
Method__str__
(self)
data_structures/linked_list/doubly_linked_list_two.py:24
Method__str__
(self)
data_structures/linked_list/doubly_linked_list_two.py:49
Method__str__
:return: Visual representation of SkipList >>> skip_list = SkipList() >>> print(skip_list) SkipList(level=0)
data_structures/linked_list/skip_list.py:59
Method__str__
(self)
data_structures/linked_list/doubly_linked_list.py:12
Method__str__
>>> linked_list = DoublyLinkedList() >>> linked_list.insert_at_tail('a') >>> linked_list.insert_at_tail('b') >>> link
data_structures/linked_list/doubly_linked_list.py:35
Method__str__
>>> str(LinkedList([])) '' >>> str(LinkedList(range(5))) '0 -> 1 -> 2 -> 3 -> 4'
data_structures/linked_list/reverse_k_group.py:45
Method__str__
Overwriting str for a pre-order print of nodes in heap; Performance is poor, so use only for small examples
data_structures/heap/binomial_heap.py:385
Method__str__
(self)
data_structures/heap/min_heap.py:10
Method__str__
( self, )
data_structures/binary_tree/avl_tree.py:296
Method__str__
Returns a string representation of the inorder traversal of the binary tree. >>> str(list(BinaryTree.build_a_tree())) '[1, 2
data_structures/binary_tree/is_sum_tree.py:89
Method__str__
Return a string of all the Nodes using in order traversal
data_structures/binary_tree/binary_search_tree.py:139
Method__str__
(self)
data_structures/binary_tree/lazy_segment_tree.py:121
Method__str__
(self)
data_structures/binary_tree/treap.py:28
Method__str__
(self)
data_structures/stacks/stack.py:32
Method__str__
(self)
data_structures/stacks/stack_with_singly_linked_list.py:16
Method__str__
>>> stack = LinkedStack() >>> stack.push("c") >>> stack.push("b") >>> stack.push("a") >>> str(stack)
data_structures/stacks/stack_with_singly_linked_list.py:59
Method__str__
To print a clause as in Conjunctive Normal Form. >>> str(Clause(["A1", "A2'", "A3"])) "{A1 , A2' , A3}"
other/davis_putnam_logemann_loveland.py:41
Method__str__
To print a formula as in Conjunctive Normal Form. >>> str(Formula([Clause(["A1", "A2'", "A3"]), Clause(["A5'", "A2'", "A1"])]))
other/davis_putnam_logemann_loveland.py:113
Method__str__
(self)
matrix/matrix_class.py:232
Method__str__
<method Matrix.__str__> Return string representation of this matrix.
matrix/sherman_morrison.py:27
← previousnext →2,701–2,800 of 3,909, ranked by callers