Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/Java
/ functions
Functions
8,444 in github.com/TheAlgorithms/Java
⨍
Functions
8,444
◇
Types & classes
1,826
↓ 1,655 callers
Method
of
(String jobName, int processingTime, int deadline)
src/main/java/com/thealgorithms/greedyalgorithms/MinimizingLateness.java:22
↓ 590 callers
Method
size
Returns the size of this stack. @return The number of elements in this stack.
src/main/java/com/thealgorithms/datastructures/stacks/Stack.java:45
↓ 522 callers
Method
get
()
src/test/java/com/thealgorithms/datastructures/trees/LazySegmentTreeTest.java:37
↓ 453 callers
Method
put
Adds a key-value pair to the cache using the default time-to-live (TTL). <p>The key may overwrite an existing entry. The actual insertion is delegate
src/main/java/com/thealgorithms/datastructures/caches/RRCache.java:146
↓ 405 callers
Method
add
()
src/test/java/com/thealgorithms/matrix/MatrixUtilTest.java:12
↓ 403 callers
Method
isEmpty
Tests if this stack is empty. @return {@code true} if this stack is empty; {@code false} otherwise.
src/main/java/com/thealgorithms/datastructures/stacks/Stack.java:38
↓ 403 callers
Method
length
Calculates the length of the linked list. @param head The head node of the linked list. @return The total number of nodes in the linked list.
src/main/java/com/thealgorithms/datastructures/lists/ReverseKGroup.java:41
↓ 342 callers
Method
append
Appends an element to the end of the list. @param element the element to append @throws NullPointerException if element is null
src/main/java/com/thealgorithms/datastructures/lists/CursorLinkedList.java:193
↓ 283 callers
Method
insert
Inserts a word into the Trie. <p> The method traverses the Trie from the root, character by character, and adds nodes if necessary. It marks the last
src/main/java/com/thealgorithms/datastructures/trees/Trie.java:64
↓ 283 callers
Method
push
Adds an element to the top of the stack. @param value The element to add.
src/main/java/com/thealgorithms/datastructures/stacks/Stack.java:15
↓ 247 callers
Method
get
(int bitIndex)
src/main/java/com/thealgorithms/ciphers/a5/LFSR.java:44
↓ 225 callers
Method
pop
Removes the element at the top of this stack and returns it. @return The element popped from the stack. @throws IllegalStateException if the stack is
src/main/java/com/thealgorithms/datastructures/stacks/Stack.java:23
↓ 213 callers
Method
add
Adds this complex number to another. @param z The number to be added. @return The sum.
src/main/java/com/thealgorithms/maths/FFT.java:74
↓ 168 callers
Method
sort
Main method arrays sorting algorithms @param unsorted - an array should be sorted @return a sorted array
src/main/java/com/thealgorithms/sorts/SortAlgorithm.java:19
↓ 143 callers
Method
addEdge
(String label, String... next)
src/main/java/com/thealgorithms/sorts/TopologicalSort.java:77
↓ 141 callers
Method
remove
Removes the specified element from the set. @param element the element to remove
src/main/java/com/thealgorithms/datastructures/crdt/ORSet.java:73
↓ 135 callers
Method
contains
(int[] arr, int value)
src/test/java/com/thealgorithms/misc/ShuffleArrayTest.java:77
↓ 114 callers
Method
peek
Returns the element at the top of this stack without removing it. @return The element at the top of this stack. @throws IllegalStateException if the
src/main/java/com/thealgorithms/datastructures/stacks/Stack.java:31
↓ 104 callers
Method
add
Adds an element to the bag. <p>This method adds the specified element to the bag. Duplicates are allowed, and the bag will maintain the order in whic
src/main/java/com/thealgorithms/datastructures/bags/Bag.java:61
↓ 86 callers
Method
get
Retrieves the value associated with the specified key from the cache. <p>If the key is not present or the corresponding entry has expired, this metho
src/main/java/com/thealgorithms/datastructures/caches/RRCache.java:112
↓ 80 callers
Method
add
Adds an element to the bucket. @param element the element to add
src/main/java/com/thealgorithms/sorts/SpreadSort.java:248
↓ 80 callers
Method
min
Returns the smaller of two {@code int} values. That is, the result the argument closer to the value of {@link Integer#MIN_VALUE}. If the arguments hav
src/main/java/com/thealgorithms/maths/MinValue.java:15
↓ 80 callers
Method
stream
Returns a sequential stream with this collection as its source. @return a stream of the elements in the array
src/main/java/com/thealgorithms/datastructures/dynamicarray/DynamicArray.java:153
↓ 77 callers
Method
addEdge
This method adds an edge to the graph between two specified vertices @param from the data of the vertex the edge is from @param to the data of the ve
src/main/java/com/thealgorithms/datastructures/graphs/MatrixGraphs.java:183
↓ 76 callers
Method
abs
Finds the magnitude of the complex number. @return The magnitude.
src/main/java/com/thealgorithms/maths/FFT.java:137
↓ 73 callers
Method
add
add in BST. if the value is not already present it is inserted or else no change takes place. @param data the value to be inserted
src/main/java/com/thealgorithms/datastructures/trees/BSTRecursive.java:122
↓ 70 callers
Method
poll
@brief Removes and returns the element at the head without blocking @return the element at the head, or null if the queue is empty
src/main/java/com/thealgorithms/datastructures/queues/ThreadSafeQueue.java:122
↓ 69 callers
Method
insert
Insert an element at the tail of the list @param data element to be added
src/main/java/com/thealgorithms/datastructures/lists/SinglyLinkedList.java:301
↓ 68 callers
Method
set
(double num)
src/main/java/com/thealgorithms/maths/MathBuilder.java:424
↓ 67 callers
Method
sqrt
()
src/main/java/com/thealgorithms/maths/MathBuilder.java:252
↓ 65 callers
Method
toString
()
src/test/java/com/thealgorithms/datastructures/heaps/IndexedPriorityQueueTest.java:31
↓ 64 callers
Method
addEdge
(int u, int v, int weight)
src/test/java/com/thealgorithms/datastructures/graphs/DialsAlgorithmTest.java:26
↓ 63 callers
Method
newSegment
(double x1, double y1, double x2, double y2)
src/test/java/com/thealgorithms/geometry/BentleyOttmannTest.java:317
↓ 62 callers
Method
toString
()
src/main/java/com/thealgorithms/ciphers/a5/LFSR.java:75
↓ 60 callers
Method
addAll
(final Map<Pair<String, String>, AffineConverter> knownConversions)
src/main/java/com/thealgorithms/conversions/UnitsConverter.java:85
↓ 57 callers
Method
fill
(int idx)
src/main/java/com/thealgorithms/datastructures/trees/BTree.java:176
↓ 56 callers
Method
distance
Computes the full Damerau–Levenshtein distance between two strings. @param s1 the first string @param s2 the second string @return the minimum edit d
src/main/java/com/thealgorithms/dynamicprogramming/DamerauLevenshteinDistance.java:33
↓ 56 callers
Method
search
()
src/test/java/com/thealgorithms/datastructures/lists/SinglyLinkedListTest.java:91
↓ 55 callers
Method
compareTo
(PileNode<T> other)
src/main/java/com/thealgorithms/sorts/PatienceSort.java:107
↓ 54 callers
Method
getKey
()
src/main/java/com/thealgorithms/ciphers/DES.java:26
↓ 54 callers
Method
isHarshad
Checks if a number is a Harshad number. A Harshad number is a positive integer that is divisible by the sum of its digits. @param n the number to be
src/main/java/com/thealgorithms/maths/HarshadNumber.java:28
↓ 54 callers
Method
max
(Node roott, int maxi)
src/main/java/com/thealgorithms/datastructures/trees/GenericTree.java:97
↓ 52 callers
Method
getSize
Returns the number of elements currently in the queue. @return Number of elements in the queue.
src/main/java/com/thealgorithms/datastructures/queues/Queue.java:129
↓ 51 callers
Method
offer
@brief Adds an element to the tail of the queue without blocking @param item the element to add @return true if the element was added, false if the qu
src/main/java/com/thealgorithms/datastructures/queues/ThreadSafeQueue.java:98
↓ 50 callers
Method
contains
Checks if the bag contains a specific element. <p>This method uses the {@code equals} method of the element to determine membership. @param element
src/main/java/com/thealgorithms/datastructures/bags/Bag.java:77
↓ 48 callers
Method
pow
Computes the value of the base raised to the power of the exponent. <p> The method calculates {@code a}<sup>{@code b}</sup> by iteratively multiplying
src/main/java/com/thealgorithms/maths/Pow.java:26
↓ 47 callers
Method
isKeith
Checks if a given number is a Keith number. <p> The algorithm works as follows: <ol> <li>Extract all digits of the number and store them in a list</l
src/main/java/com/thealgorithms/maths/KeithNumber.java:46
↓ 47 callers
Method
swap
Swaps two elements at the given positions in an array. @param array the array in which to swap elements @param i the index of the first element t
src/main/java/com/thealgorithms/sorts/SortUtils.java:19
↓ 46 callers
Method
containsKey
Checks whether the given key exists in the map. @param key key to check @return true if key exists, false otherwise
src/main/java/com/thealgorithms/datastructures/hashmap/hashing/ImmutableHashMap.java:80
↓ 46 callers
Method
createTree
Creates a binary tree with given values @param values: Level order representation of tree @return Root of a binary tree
src/test/java/com/thealgorithms/datastructures/trees/TreeTestUtils.java:17
↓ 46 callers
Method
toArray
Returns an array containing all elements in the bucket. @return an array containing all elements in the bucket
src/main/java/com/thealgorithms/sorts/SpreadSort.java:269
↓ 45 callers
Method
encrypt
Encrypts the plaintext with the key and returns the result @param plainText which we want to encrypt @param key the key for encrypt @return Encrypted
src/main/java/com/thealgorithms/ciphers/AES.java:2689
↓ 44 callers
Method
build
()
src/test/java/com/thealgorithms/datastructures/trees/LazySegmentTreeTest.java:9
↓ 43 callers
Method
get
Retrieves and removes the item at the front of the buffer (FIFO). This operation will move the {@code getPointer} forward. @return The item at the fr
src/main/java/com/thealgorithms/datastructures/buffers/CircularBuffer.java:62
↓ 43 callers
Method
less
Compares two elements to see if the first is less than the second. @param firstElement the first element to compare @param secondElement the second
src/main/java/com/thealgorithms/sorts/SortUtils.java:34
↓ 43 callers
Method
put
Adds an item to the end of the buffer (FIFO). If the buffer is full, this operation will overwrite the oldest data. @param item The item to be added.
src/main/java/com/thealgorithms/datastructures/buffers/CircularBuffer.java:80
↓ 42 callers
Method
add
Add two points on the elliptic curve.
src/main/java/com/thealgorithms/ciphers/ECC.java:187
↓ 42 callers
Method
decrypt
Decrypts the ciphertext with the key and returns the result @param cipherText The Encrypted text which we want to decrypt @return decryptedText
src/main/java/com/thealgorithms/ciphers/AES.java:2717
↓ 42 callers
Method
get
Retrieves the exact value at a specific leaf node. @param index The column index. @return The value at the given index.
src/main/java/com/thealgorithms/datastructures/trees/SegmentTree2D.java:76
↓ 42 callers
Method
print
Prints the elements of the queue.
src/main/java/com/thealgorithms/datastructures/heaps/MinPriorityQueue.java:95
↓ 41 callers
Method
getValue
()
src/main/java/com/thealgorithms/datastructures/Node.java:21
↓ 40 callers
Method
addEdge
@param x Source Vertex @param y End vertex @param z Weight
src/main/java/com/thealgorithms/datastructures/graphs/BellmanFord.java:177
↓ 40 callers
Method
indexOf
Finds the logical index of a specified element in the list. @param element the element to search for in the list @return the logical index of the ele
src/main/java/com/thealgorithms/datastructures/lists/CursorLinkedList.java:75
↓ 39 callers
Method
getMedian
Finds the median of the elements between the specified range. @param arr the input array @param begin the starting index @param end the ending index
src/main/java/com/thealgorithms/others/BFPRT.java:137
↓ 39 callers
Method
makeSet
Creates a new disjoint set containing the single specified element. @param value the element to be placed in a new singleton set @return a node repre
src/main/java/com/thealgorithms/datastructures/disjointsetunion/DisjointSetUnion.java:22
↓ 38 callers
Method
getSortAlgorithm
()
src/test/java/com/thealgorithms/sorts/SortingAlgorithmTest.java:15
↓ 37 callers
Method
convert
(String numberInWords)
src/main/java/com/thealgorithms/conversions/WordsToNumber.java:96
↓ 37 callers
Method
find
@param key is an element which should be found @param array is an array where the element should be found @param <T> Comparable type @return first fou
src/main/java/com/thealgorithms/devutils/searches/SearchAlgorithm.java:15
↓ 37 callers
Method
get
Retrieves the maximum item from the heap without removing it. @return the maximum item
src/main/java/com/thealgorithms/datastructures/heaps/GenericHeap.java:104
↓ 37 callers
Method
put
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.
src/main/java/com/thealgorithms/datastructures/hashmap/hashing/GenericHashMapUsingArray.java:59
↓ 36 callers
Method
enqueue
Adds an element to the rear of the queue. @param data the element to insert. @throws IllegalArgumentException if data is null.
src/main/java/com/thealgorithms/datastructures/queues/LinkedQueue.java:49
↓ 36 callers
Method
parseInt
Parse a string to integer @param s the string @return the integer value represented by the argument in decimal. @throws NumberFormatException if the
src/main/java/com/thealgorithms/maths/ParseInteger.java:34
↓ 35 callers
Method
isKrishnamurthy
Checks if a number is a Krishnamurthy number. <p> A number is a Krishnamurthy number if the sum of the factorials of its digits equals the number its
src/main/java/com/thealgorithms/maths/KrishnamurthyNumber.java:55
↓ 35 callers
Method
max
Returns the greater of two {@code int} values. That is, the result is the argument closer to the value of {@link Integer#MAX_VALUE}. If the arguments
src/main/java/com/thealgorithms/maths/MaxValue.java:15
↓ 35 callers
Method
toString
()
src/main/java/com/thealgorithms/compression/BurrowsWheelerTransform.java:100
↓ 34 callers
Method
contains
Checks if an element might be in the Bloom filter. <p> This method checks the bits at the positions computed by each hash function. If any of these bi
src/main/java/com/thealgorithms/datastructures/bloomfilter/BloomFilter.java:87
↓ 34 callers
Method
enQueue
Adds a new element to the queue. If the queue is full, an exception is thrown. @param value the element to be added to the queue @throws IllegalState
src/main/java/com/thealgorithms/datastructures/queues/CircularQueue.java:74
↓ 34 callers
Method
print
()
src/main/java/com/thealgorithms/maths/MathBuilder.java:444
↓ 34 callers
Method
toLowerCase
Converts all of the characters in this {@code String} to lower case @param s the string to convert @return the {@code String}, converted to lowercase
src/main/java/com/thealgorithms/strings/Lower.java:23
↓ 33 callers
Method
get
()
src/main/java/com/thealgorithms/maths/MathBuilder.java:21
↓ 33 callers
Method
insert
Inserts the specified key-value pair into the hash map. If the key already exists, the value is updated. @param key the key to be inserted @param v
src/main/java/com/thealgorithms/datastructures/hashmap/hashing/HashMap.java:53
↓ 32 callers
Method
delete
()
src/test/java/com/thealgorithms/datastructures/trees/KDTreeTest.java:29
↓ 32 callers
Method
setEdge
Sets an edge in the adjacency matrix @param from source node (1-indexed) @param to destination node (1-indexed) @param value 1 if edge exists, 0
src/main/java/com/thealgorithms/others/PageRank.java:92
↓ 31 callers
Method
findSet
Finds and returns the representative (root) of the set containing the given node. This method applies path compression to flatten the tree structure f
src/main/java/com/thealgorithms/datastructures/disjointsetunion/DisjointSetUnion.java:33
↓ 31 callers
Method
search
Searches for the value associated with the specified key in the hash map. @param key the key whose associated value is to be returned @return the val
src/main/java/com/thealgorithms/datastructures/hashmap/hashing/HashMap.java:74
↓ 31 callers
Method
select
Selects the {@code n}-th largest element of {@code list}, i.e. the element that would be at index n if the list was sorted. <p> Calling this function
src/main/java/com/thealgorithms/searches/QuickSelect.java:31
↓ 30 callers
Method
add
Adds a building with the given left, height, and right values to the buildings list. @param left The left x-coordinate of the building. @param heig
src/main/java/com/thealgorithms/others/SkylineProblem.java:24
↓ 30 callers
Method
floor
Returns the largest (closest to positive infinity) @param number the number @return the largest (closest to positive infinity) of given {@code number
src/main/java/com/thealgorithms/maths/Floor.java:15
↓ 29 callers
Method
addTask
Adds a task to the scheduler with a given priority. @param name name of the task @param priority priority of the task
src/main/java/com/thealgorithms/scheduling/AgingScheduling.java:42
↓ 29 callers
Method
get
Retrieves the value associated with the given key from the cache. If the key exists, the node's frequency is incremented, and the node is repositioned
src/main/java/com/thealgorithms/datastructures/caches/LFUCache.java:89
↓ 29 callers
Method
put
Inserts or updates a key-value pair in the cache. If the key already exists, the value is updated and its frequency is incremented. If the cache is fu
src/main/java/com/thealgorithms/datastructures/caches/LFUCache.java:108
↓ 29 callers
Method
put
Inserts certain value into the Binary Tree @param value Value to be inserted
src/main/java/com/thealgorithms/datastructures/trees/BinaryTree.java:108
↓ 29 callers
Method
rotateRight
Performs a circular right rotation (right shift) on a 32-bit integer. Bits shifted out from the right side are inserted on the left side. @param valu
src/main/java/com/thealgorithms/bitmanipulation/BitRotate.java:68
↓ 29 callers
Method
toString
()
src/test/java/com/thealgorithms/sorts/SortingAlgorithmTest.java:300
↓ 28 callers
Method
addFirst
Adds the specified value to the head of the deque @param val Value to add to the deque
src/main/java/com/thealgorithms/datastructures/queues/Deque.java:38
↓ 28 callers
Method
getArrivalTime
()
src/main/java/com/thealgorithms/devutils/entities/ProcessDetails.java:28
↓ 28 callers
Method
getWaitingTime
()
src/main/java/com/thealgorithms/scheduling/EDFScheduling.java:83
↓ 28 callers
Method
insert
Inserts an element into the Bloom filter. <p> This method hashes the element using all defined hash functions and sets the corresponding bits in the b
src/main/java/com/thealgorithms/datastructures/bloomfilter/BloomFilter.java:66
↓ 28 callers
Method
insert
insert a node into the Treap @param value value to be inserted into the Treap @return root of the Treap where the value is inserted
src/main/java/com/thealgorithms/datastructures/trees/Treap.java:139
↓ 28 callers
Method
split
(int[][] p, int[][] c, int iB, int jB)
src/main/java/com/thealgorithms/divideandconquer/StrassenMatrixMultiplication.java:126
next →
1–100 of 8,444, ranked by callers