MCPcopy Create free account

hub / github.com/TheAlgorithms/Java / functions

Functions8,444 in github.com/TheAlgorithms/Java

↓ 6 callersMethodcompute
Computes the n-th Tribonacci number. @param n the index of the Tribonacci number to compute @return the n-th Tribonacci number
src/main/java/com/thealgorithms/dynamicprogramming/Tribonacci.java:17
↓ 6 callersMethodcreateAdjacencyList
(int numVertices, int[][] edges)
src/test/java/com/thealgorithms/datastructures/graphs/BipartiteGraphDFSTest.java:12
↓ 6 callersMethodcreateBST
(int[] array)
src/main/java/com/thealgorithms/datastructures/trees/BSTFromSortedArray.java:15
↓ 6 callersMethodcreateComplexTree
()
src/test/java/com/thealgorithms/datastructures/trees/SplayTreeTest.java:89
↓ 6 callersMethodcreateLinkedList
(int[] values)
src/test/java/com/thealgorithms/datastructures/lists/RotateSinglyLinkedListsTest.java:17
↓ 6 callersMethodcreateTree
(final Integer[] preorder, final Integer[] inorder)
src/main/java/com/thealgorithms/datastructures/trees/CreateBinaryTreeFromInorderPreorder.java:23
↓ 6 callersMethodcreateTreeOptimized
(final Integer[] preorder, final Integer[] inorder)
src/main/java/com/thealgorithms/datastructures/trees/CreateBinaryTreeFromInorderPreorder.java:30
↓ 6 callersMethoddecimalToBcd
Converts a decimal number to BCD (Binary-Coded Decimal). <p>Steps: <p>1. Check if the decimal number is within the valid range for BCD (0 to 9999). <p
src/main/java/com/thealgorithms/bitmanipulation/BcdConversion.java:67
↓ 6 callersMethoddecompress
Decompresses a BigDecimal number back into the original string. @param compressed The compressed BigDecimal number. @param length The
src/main/java/com/thealgorithms/compression/ArithmeticCoding.java:83
↓ 6 callersMethoddeleteElement
Delete an element in the heap. @param elementIndex int containing the position in the heap of the element to be deleted.
src/main/java/com/thealgorithms/datastructures/heaps/Heap.java:43
↓ 6 callersMethoddeterminant
Calculates the determinant of a given matrix. @param a the input matrix @param n the size of the matrix @return the determinant of the matrix
src/main/java/com/thealgorithms/maths/DeterminantOfMatrix.java:18
↓ 6 callersMethoddigitSeparationReverseOrder
Separates the digits of a large positive number into a list in reverse order. @param largeNumber The large number to separate digits from. @return A l
src/main/java/com/thealgorithms/greedyalgorithms/DigitSeparation.java:18
↓ 6 callersMethoddigitalRoot
(int n)
src/main/java/com/thealgorithms/maths/DigitalRoot.java:42
↓ 6 callersMethodequals
(Object o)
src/main/java/com/thealgorithms/geometry/BentleyOttmann.java:114
↓ 6 callersMethodexecute
Executes the process for a given time slice. @param timeSlice The amount of time the process is executed
src/main/java/com/thealgorithms/scheduling/MLFQScheduler.java:133
↓ 6 callersMethodfind
(T[] array, T key)
src/main/java/com/thealgorithms/searches/RotatedBinarySearch.java:22
↓ 6 callersMethodfind
Finds the index of the specified key in a sorted array using exponential search. @param array The sorted array to search. @param key The element to s
src/main/java/com/thealgorithms/searches/ExponentialSearch.java:32
↓ 6 callersMethodfind
(int i)
src/main/java/com/thealgorithms/randomized/KargerMinCut.java:89
↓ 6 callersMethodfloodFill
Fill the 2D image with new color @param image The image to be filled @param x The x coordinate at which color is to be filled @param y The y coordina
src/main/java/com/thealgorithms/backtracking/FloodFill.java:43
↓ 6 callersMethodgenerateFloydTriangle
Generates a Floyd Triangle with the specified number of rows. @param rows The number of rows in the triangle. @return A List representing the Floyd T
src/main/java/com/thealgorithms/others/FloydTriangle.java:16
↓ 6 callersMethodgenerateKey
Generates a random key of the given length in bytes. @param length the length of the key in bytes, must be non-negative @return a new random key @thr
src/main/java/com/thealgorithms/ciphers/OneTimePadCipher.java:34
↓ 6 callersMethodgenerateRandomPoints
Generates random points for testing the Pi approximation. @param numPoints Number of random points to generate @return List of random points
src/main/java/com/thealgorithms/maths/PiApproximation.java:62
↓ 6 callersMethodgenerateTestBinary
(int a, int b, int c, int d)
src/test/java/com/thealgorithms/conversions/IPConverterTest.java:13
↓ 6 callersMethodgenerateTestIP
(int a, int b, int c, int d)
src/test/java/com/thealgorithms/conversions/IPConverterTest.java:9
↓ 6 callersMethodgetAxis
()
src/main/java/com/thealgorithms/datastructures/trees/KDTree.java:167
↓ 6 callersMethodgetDocId
()
src/main/java/com/thealgorithms/searches/BM25InvertedIndex.java:69
↓ 6 callersMethodgetElementKey
Retrieves the key value of an element at the specified index. @param elementIndex 1-based index of the element @return double value representing the
src/main/java/com/thealgorithms/datastructures/heaps/MinHeap.java:88
↓ 6 callersMethodgetGcd
Gets the GCD value. @return the GCD
src/main/java/com/thealgorithms/maths/LinearDiophantineEquationsSolver.java:263
↓ 6 callersMethodgetMaximumElement
Returns the maximum element present in the stack @return The element at the top of the maxStack, or null if the stack is empty.
src/main/java/com/thealgorithms/stacks/GreatestElementConstantTime.java:68
↓ 6 callersMethodgetMinimumElement
Returns the minimum element present in the stack @return The element at the top of the minStack, or null if the stack is empty.
src/main/java/com/thealgorithms/stacks/SmallestElementConstantTime.java:68
↓ 6 callersMethodgetNQueensArrangements
(int queens)
src/main/java/com/thealgorithms/backtracking/NQueens.java:56
↓ 6 callersMethodgetRange
Get Node of given range in O(log n) time. @param left The left index of the range to update. @param right The right index of the range to update. @re
src/main/java/com/thealgorithms/datastructures/trees/LazySegmentTree.java:151
↓ 6 callersMethodgetResultArray
Reconstructs the final array using prefix sums. @return The resulting array after all updates. Returns long[] to handle potential overflows.
src/main/java/com/thealgorithms/prefixsum/DifferenceArray.java:78
↓ 6 callersMethodgetSize
Returns the current number of elements in the array. @return the number of elements in the array
src/main/java/com/thealgorithms/datastructures/dynamicarray/DynamicArray.java:120
↓ 6 callersMethodgetSortedCopyOfList
(Collection<T> list)
src/test/java/com/thealgorithms/searches/QuickSelectTest.java:229
↓ 6 callersMethodgetSuffixLink
()
src/main/java/com/thealgorithms/strings/AhoCorasick.java:43
↓ 6 callersMethodgetTo
()
src/main/java/com/thealgorithms/datastructures/graphs/AStar.java:60
↓ 6 callersMethodgetTurnAroundTime
()
src/main/java/com/thealgorithms/scheduling/EDFScheduling.java:91
↓ 6 callersMethodgetValue
()
src/main/java/com/thealgorithms/datastructures/lists/SkipList.java:258
↓ 6 callersMethodgetWaitingTime
()
src/main/java/com/thealgorithms/devutils/entities/ProcessDetails.java:36
↓ 6 callersMethodhashFunction1
Computes the first hash index for a given key using the modulo operation. @param key the key for which the hash index is computed @return an integer
src/main/java/com/thealgorithms/datastructures/hashmap/hashing/HashMapCuckooHashing.java:41
↓ 6 callersMethodhashFunction2
Computes the second hash index for a given key using integer division. @param key the key for which the hash index is computed @return an integer ind
src/main/java/com/thealgorithms/datastructures/hashmap/hashing/HashMapCuckooHashing.java:55
↓ 6 callersMethodinsertHead
Insert an element at the head @param x Element to be inserted
src/main/java/com/thealgorithms/datastructures/lists/DoublyLinkedList.java:193
↓ 6 callersMethodinterpolate
Linear interpolation between two values. @param a value at alpha = 0 @param b value at alpha = 1 @param alpha interpolation factor in [0, 1]
src/main/java/com/thealgorithms/others/PerlinNoise.java:172
↓ 6 callersMethodinterpolate
Evaluates the polynomial that passes through the given points at a specific x-coordinate. @param x The x-coordinates of the points. Must be the same
src/main/java/com/thealgorithms/maths/Neville.java:33
↓ 6 callersMethodisBalancedIterative
Iterative is BT balanced implementation
src/main/java/com/thealgorithms/datastructures/trees/CheckIfBinaryTreeBalanced.java:74
↓ 6 callersMethodisBalancedRecursive
Recursive is BT balanced implementation @param root The binary tree to check if balanced
src/main/java/com/thealgorithms/datastructures/trees/CheckIfBinaryTreeBalanced.java:25
↓ 6 callersMethodisBipartite
Method to check if the graph is bipartite. @param v Number of vertices in the graph @param adj Adjacency list of the graph @return True if the g
src/main/java/com/thealgorithms/datastructures/graphs/BipartiteGraphDFS.java:71
↓ 6 callersMethodisCounterClockwise
Helper method to verify if points are in counter-clockwise order. Uses the signed area method: positive area means CCW.
src/test/java/com/thealgorithms/geometry/ConvexHullTest.java:87
↓ 6 callersMethodisEmpty
Checks if the queue is empty. @return true if the queue is empty, otherwise false.
src/main/java/com/thealgorithms/datastructures/queues/LinkedQueue.java:39
↓ 6 callersMethodisEmpty
@brief Checks if the queue is empty @return true if the queue contains no elements
src/main/java/com/thealgorithms/datastructures/queues/ThreadSafeQueue.java:157
↓ 6 callersMethodisEmpty
Checks if the queue is empty. @return {@code true} if the queue has no elements; {@code false} otherwise.
src/main/java/com/thealgorithms/datastructures/queues/GenericArrayListQueue.java:29
↓ 6 callersMethodisExpired
Checks if the cache entry has expired. @return {@code true} if the current time is past the expiration time; {@code false} otherwise
src/main/java/com/thealgorithms/datastructures/caches/FIFOCache.java:79
↓ 6 callersMethodisExpired
Checks if the cache entry has expired. @return {@code true} if the current time is past the expiration time; {@code false} otherwise
src/main/java/com/thealgorithms/datastructures/caches/LIFOCache.java:82
↓ 6 callersMethodisFull
Returns true if the queue is full @return true if the queue is full
src/main/java/com/thealgorithms/datastructures/queues/PriorityQueues.java:167
↓ 6 callersMethodisFull
Checks if the queue is full. @return {@code true} if the queue has reached its maximum capacity; {@code false} otherwise
src/main/java/com/thealgorithms/datastructures/queues/CircularQueue.java:64
↓ 6 callersMethodisSolutionExists
Returns whether the given boolean formula is satisfiable. @return {@code true} if a solution exists; {@code false} otherwise @throws Error if called
src/main/java/com/thealgorithms/datastructures/graphs/TwoSat.java:198
↓ 6 callersMethodisStrobogrammatic
Check if a number is strobogrammatic @param number the number to be checked @return true if the number is strobogrammatic, false otherwise
src/main/java/com/thealgorithms/maths/StrobogrammaticNumber.java:18
↓ 6 callersMethoditerativeBoundaryTraversal
(BinaryTree.Node root)
src/main/java/com/thealgorithms/datastructures/trees/BoundaryTraversal.java:123
↓ 6 callersMethodjohnsonAlgorithm
Executes Johnson's algorithm on the given graph. Steps: 1. Add a new vertex to the graph and run Bellman-Ford to compute modified weights 2. t the gra
src/main/java/com/thealgorithms/datastructures/graphs/JohnsonsAlgorithm.java:40
↓ 6 callersMethodmapIndex
(int index, int n)
src/main/java/com/thealgorithms/sorts/WiggleSort.java:25
↓ 6 callersMethodmaxFlow
Computes the maximum flow from source to sink using Dinic's algorithm. @param capacity square capacity matrix (n x n); entries must be >= 0 @param so
src/main/java/com/thealgorithms/graph/Dinic.java:37
↓ 6 callersMethodmaxMatching
Returns the size of the maximum matching.
src/main/java/com/thealgorithms/graph/HopcroftKarp.java:42
↓ 6 callersMethodmaxSumKSizeSubarray
This method finds the maximum sum of a subarray of a given size k. @param arr is the input array where the maximum sum needs to be found @param k i
src/main/java/com/thealgorithms/slidingwindow/MaxSumKSizeSubarray.java:28
↓ 6 callersMethodmerge
Merges the state of this G-Counter with another G-Counter. @param other The other G-Counter to merge with.
src/main/java/com/thealgorithms/datastructures/crdt/GCounter.java:79
↓ 6 callersMethodmergeAccounts
(List<List<String>> accounts)
src/main/java/com/thealgorithms/graph/AccountMerge.java:20
↓ 6 callersMethodmergeCellsIntoBlock
Returns the 128-bit BigInteger representation of the input of an array of 8-bit integers. @param cells that we need to merge @return block of merged
src/main/java/com/thealgorithms/ciphers/AES.java:2510
↓ 6 callersMethodmiddleNode
Returns the middle node of the list. @param head the head of the singly linked list; may be {@code null} @return the middle node (second middle for e
src/main/java/com/thealgorithms/datastructures/lists/MiddleOfLinkedList.java:31
↓ 6 callersMethodminSumKSizeSubarray
This method finds the minimum sum of a subarray of a given size k. @param arr is the input array where the minimum sum needs to be found @param k i
src/main/java/com/thealgorithms/slidingwindow/MinSumKSizeSubarray.java:30
↓ 6 callersMethodminimumSumPartition
(final int[] array)
src/main/java/com/thealgorithms/dynamicprogramming/MinimumSumPartition.java:32
↓ 6 callersMethodmirrorMatrix
(final double[][] originalMatrix)
src/main/java/com/thealgorithms/matrix/MirrorOfMatrix.java:23
↓ 6 callersMethodmyAtoi
Converts the given string to a 32-bit signed integer. The conversion discards any leading whitespace characters until the first non-whitespace charact
src/main/java/com/thealgorithms/strings/MyAtoi.java:25
↓ 6 callersMethodnotifyEviction
Notifies the eviction listener, if one is registered, that a key-value pair has been evicted. <p>If the {@code evictionListener} is not {@code null},
src/main/java/com/thealgorithms/datastructures/caches/FIFOCache.java:254
↓ 6 callersMethodnotifyEviction
Notifies the eviction listener, if one is registered, that a key-value pair has been evicted. <p>If the {@code evictionListener} is not {@code null},
src/main/java/com/thealgorithms/datastructures/caches/LIFOCache.java:267
↓ 6 callersMethodnthManShanksPrime
Calculates the nth New Man Shanks prime and checks if it equals the expected answer. @param n the index of the New Man Shanks prime to calculate (0-b
src/main/java/com/thealgorithms/dynamicprogramming/NewManShanksPrime.java:37
↓ 6 callersMethodnumberOfEdges
Getter for `this.edgeCount` @return the number of edges
src/main/java/com/thealgorithms/datastructures/graphs/MatrixGraphs.java:117
↓ 6 callersMethodpop
Removes and returns the item at the top of the stack. @return the item at the top of the stack, or {@code null} if the stack is empty @throws Illegal
src/main/java/com/thealgorithms/datastructures/stacks/NodeStack.java:58
↓ 6 callersMethodprettyDisplay
Displays the tree is a structured format
src/main/java/com/thealgorithms/datastructures/trees/BSTRecursiveGeneric.java:35
↓ 6 callersMethodqueryMaxInPath
(int u, int v)
src/main/java/com/thealgorithms/datastructures/trees/HeavyLightDecomposition.java:129
↓ 6 callersMethodreplace
Replaces an element in the array with the given item and returns the replaced item. @param <T> The type of elements in the array, which must be com
src/main/java/com/thealgorithms/sorts/CycleSort.java:83
↓ 6 callersMethodresolveCollision
Resolve instantaneous elastic collision between two circular bodies. @param a first body @param b second body
src/main/java/com/thealgorithms/physics/ElasticCollision2D.java:39
↓ 6 callersMethodreverseStack
Reverses the order of elements in the given stack using recursion. Steps: 1. Check if the stack is empty. If so, return. 2. Pop the top element from t
src/main/java/com/thealgorithms/datastructures/stacks/ReverseStack.java:40
↓ 6 callersMethodrotateLeft
Performs a left rotation on the given array by the specified number of positions. @param arr the array to be rotated @param n the number of positions
src/main/java/com/thealgorithms/others/ArrayLeftRotation.java:21
↓ 6 callersMethodrun
Finds the shortest paths from a source vertex to all other vertices in a weighted graph. @param graph The graph represented as an adjacency list. @pa
src/main/java/com/thealgorithms/datastructures/graphs/DialsAlgorithm.java:60
↓ 6 callersMethodsearch
(String text)
src/main/java/com/thealgorithms/searches/BoyerMoore.java:28
↓ 6 callersMethodsearch
Search for a key in the SplayTree. @param key The key to search for. @return True if the key is found, otherwise false.
src/main/java/com/thealgorithms/datastructures/trees/SplayTree.java:59
↓ 6 callersMethodsetNext
(HeapNode newNext)
src/main/java/com/thealgorithms/datastructures/heaps/FibonacciHeap.java:431
↓ 6 callersMethodsetNextEntry
(Entry<I, J> nextEntry)
src/main/java/com/thealgorithms/datastructures/caches/LRUCache.java:215
↓ 6 callersMethodshortestPaths
Computes shortest distances from {@code src} in a graph whose edges have weight 0 or 1. @param n the number of vertices, labeled {@code 0..n-1} @para
src/main/java/com/thealgorithms/graph/ZeroOneBfs.java:35
↓ 6 callersMethodsize
Return the number of elements in the heap $ret == 0 if heap is empty
src/main/java/com/thealgorithms/datastructures/heaps/FibonacciHeap.java:159
↓ 6 callersMethodsolveRangeFrequencyQueries
Solves range frequency queries using Mo's Algorithm Example: Count occurrences of a specific value in range [L, R] @param arr the input array @param
src/main/java/com/thealgorithms/others/MosAlgorithm.java:116
↓ 6 callersMethodsolveSudoku
Solves the Sudoku puzzle using backtracking @param board 9x9 Sudoku board with 0 representing empty cells @return true if puzzle is solved, false oth
src/main/java/com/thealgorithms/backtracking/SudokuSolver.java:25
↓ 6 callersMethodsort
Sorts the array using the Dark Sort algorithm. @param unsorted the array to be sorted @return sorted array
src/main/java/com/thealgorithms/sorts/DarkSort.java:17
↓ 6 callersMethodsortList
Sorts the linked list using the QuickSort algorithm. The sorted list replaces the original list within the SinglyLinkedList instance.
src/main/java/com/thealgorithms/datastructures/lists/QuickSortLinkedList.java:124
↓ 6 callersMethodsplitBlockIntoCells
representation of the input 128-bit block as an array of 8-bit integers. @param block of 128-bit integers @return array of 8-bit integers
src/main/java/com/thealgorithms/ciphers/AES.java:2485
↓ 6 callersMethodstronglyConnectedComponents
Finds and returns the strongly connected components (SCCs) of the directed graph. @param v the number of vertices in the graph @param graph the adjac
src/main/java/com/thealgorithms/datastructures/graphs/TarjansAlgorithm.java:73
↓ 6 callersMethodsub
(int[][] a, int[][] b)
src/main/java/com/thealgorithms/divideandconquer/StrassenMatrixMultiplication.java:96
↓ 6 callersMethodtoString
Returns a string representation of this {@code ADTFraction} in the format {@code numerator}/{@code denominator}. @return A string representation of t
src/main/java/com/thealgorithms/maths/ADTFraction.java:76
↓ 6 callersMethodtop
Retrieves the top element of the stack. @return The top element.
src/main/java/com/thealgorithms/stacks/MinStackUsingTwoStacks.java:45
↓ 6 callersMethodtopSortOrder
Returns an ArrayList containing the vertices of the graph arranged in topological order. Topological sorting ensures that for any directed edge (u, v)
src/main/java/com/thealgorithms/datastructures/graphs/KahnsAlgorithm.java:108
← previousnext →601–700 of 8,444, ranked by callers