MCPcopy Create free account

hub / github.com/TheAlgorithms/Java / functions

Functions8,444 in github.com/TheAlgorithms/Java

↓ 12 callersMethodequals
(Object obj)
src/test/java/com/thealgorithms/datastructures/caches/LRUCacheTest.java:125
↓ 12 callersMethodfibBinet
We have only defined the nth Fibonacci number in terms of the two before it. Now, we will look at Binet's formula to calculate the nth Fibonacci numbe
src/main/java/com/thealgorithms/dynamicprogramming/Fibonacci.java:123
↓ 12 callersMethodfibBotUp
This method finds the nth fibonacci number using bottom up @param n The input n for which we have to determine the fibonacci number Outputs the nth f
src/main/java/com/thealgorithms/dynamicprogramming/Fibonacci.java:60
↓ 12 callersMethodfibMemo
This method finds the nth fibonacci number using memoization technique @param n The input n for which we have to determine the fibonacci number Outpu
src/main/java/com/thealgorithms/dynamicprogramming/Fibonacci.java:34
↓ 12 callersMethodfibOptimized
This method finds the nth fibonacci number using bottom up @param n The input n for which we have to determine the fibonacci number Outputs the nth f
src/main/java/com/thealgorithms/dynamicprogramming/Fibonacci.java:93
↓ 12 callersMethodfindFirst
Case sensitive version version of the algorithm @param pattern the pattern to be searched for (needle) @param text the text being searched in (haysta
src/main/java/com/thealgorithms/strings/HorspoolSearch.java:62
↓ 12 callersMethodfindKthMax
(int[] array, int k)
src/main/java/com/thealgorithms/maths/FindKthNumber.java:16
↓ 12 callersMethodfindKthMaxUsingHeap
(int[] array, int k)
src/main/java/com/thealgorithms/maths/FindKthNumber.java:68
↓ 12 callersMethodfindPaths
Finds all paths from the top-left to the bottom-right of the given maze. @param maze an {@code n x n} binary matrix where {@code 1} = open, {@code 0}
src/main/java/com/thealgorithms/backtracking/RatInAMaze.java:44
↓ 12 callersMethodfloodFill
Iteratively 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 @
src/main/java/com/thealgorithms/others/IterativeFloodFill.java:41
↓ 12 callersMethodgcd
get greatest common divisor @param a the first number @param b the second number @return gcd
src/main/java/com/thealgorithms/maths/GCDRecursion.java:26
↓ 12 callersMethodgenerateRandomMess
Random messages, consisted of 0's and 1's, are generated, so that they can later be transmitted
src/main/java/com/thealgorithms/others/CRCAlgorithm.java:110
↓ 12 callersMethodgetBurstTime
()
src/main/java/com/thealgorithms/devutils/entities/ProcessDetails.java:32
↓ 12 callersMethodgetErrorType
()
src/main/java/com/thealgorithms/conversions/WordsToNumber.java:340
↓ 12 callersMethodgetNext
Gets the next node in the linked list. @return the next node in the linked list
src/main/java/com/thealgorithms/datastructures/hashmap/hashing/HashMap.java:286
↓ 12 callersMethodheight
(Node node)
src/main/java/com/thealgorithms/datastructures/trees/AVLSimple.java:111
↓ 12 callersMethodinsert
Inserts a value into the threaded binary tree. Duplicate values are inserted to the right subtree (consistent deterministic rule). @param value the i
src/main/java/com/thealgorithms/datastructures/trees/ThreadedBinaryTree.java:53
↓ 12 callersMethodisEmpty
Checks if the circular buffer is empty. This method is based on the current size of the buffer. @return {@code true} if the buffer is empty, {@code f
src/main/java/com/thealgorithms/datastructures/buffers/CircularBuffer.java:42
↓ 12 callersMethodjacobsthal
Calculates the nth term of the Jacobsthal Sequence. @param n the index of the sequence (must be non-negative) @return the nth term of the Jacobsthal
src/main/java/com/thealgorithms/maths/JacobsthalNumber.java:24
↓ 12 callersMethodkmpMatcher
find the starting index in string haystack[] that matches the search word P[] @param haystack The text to be searched @param needle The pattern to
src/main/java/com/thealgorithms/strings/KMP.java:21
↓ 12 callersMethodmakeGraph
Creates a graph with the specified number of vertices and edges. @param numberOfVertices the total number of vertices @param listOfEdges a 2D array r
src/main/java/com/thealgorithms/datastructures/graphs/WelshPowell.java:110
↓ 12 callersMethodmaxProduct
Finds the maximum product of any contiguous subarray in the given array. @param nums an array of integers which may contain positive, negative,
src/main/java/com/thealgorithms/dynamicprogramming/MaximumProductSubarray.java:31
↓ 12 callersMethodminWindow
Finds the minimum window substring of 's' containing all characters of 't'. @param s The input string to search within. @param t The string with requ
src/main/java/com/thealgorithms/slidingwindow/MinimumWindowSubstring.java:27
↓ 12 callersMethodmultiply
()
src/test/java/com/thealgorithms/matrix/MatrixUtilTest.java:55
↓ 12 callersMethodnetworkFlow
Computes the maximum flow in a flow network using the Ford-Fulkerson algorithm. @param vertexCount the number of vertices in the flow network @param
src/main/java/com/thealgorithms/datastructures/graphs/FordFulkerson.java:30
↓ 12 callersMethodpadovan
Calculates the nth term of the Padovan Sequence. @param n the index of the sequence (must be non-negative) @return the nth term of the Padovan Sequen
src/main/java/com/thealgorithms/maths/PadovanSequence.java:24
↓ 12 callersMethodperrin
Calculates the nth term of the Perrin Sequence. @param n the index of the sequence (must be non-negative) @return the nth term of the Perrin Sequence
src/main/java/com/thealgorithms/maths/PerrinNumber.java:28
↓ 12 callersMethodremoveKey
()
src/test/java/com/thealgorithms/datastructures/hashmap/hashing/HashMapCuckooHashingTest.java:40
↓ 12 callersMethodrun
Executes Dijkstra's algorithm on the provided graph to find the shortest paths from the source vertex to all other vertices. The graph is represented
src/main/java/com/thealgorithms/datastructures/graphs/DijkstraAlgorithm.java:48
↓ 12 callersMethodsolve
Solves the CSP to find the shortest path from the start node to the target node without exceeding the resource constraint. @param start the starting
src/main/java/com/thealgorithms/graph/ConstrainedShortestPath.java:87
↓ 11 callersMethodadd
(E e)
src/main/java/com/thealgorithms/datastructures/lists/SkipList.java:70
↓ 11 callersMethodadd
(String str)
src/main/java/com/thealgorithms/puzzlesandgames/WordBoggle.java:112
↓ 11 callersMethodaddBinary
Adds two binary strings and returns their sum as a binary string. @param a First binary string. @param b Second binary string. @return Binary string r
src/main/java/com/thealgorithms/greedyalgorithms/BinaryAddition.java:55
↓ 11 callersMethodapproximate
Approximates the definite integral of a given function over a specified interval using the Monte Carlo method with a fixed random seed for reproducibi
src/main/java/com/thealgorithms/randomized/MonteCarloIntegration.java:44
↓ 11 callersMethodcalculatePower
(long x, long y)
src/main/java/com/thealgorithms/divideandconquer/BinaryExponentiation.java:18
↓ 11 callersMethodchangeMess
Once the message is transmitted, some of it's elements, is possible to change from 1 to 0, or from 0 to 1, because of the Bit Error Rate (ber). For ev
src/main/java/com/thealgorithms/others/CRCAlgorithm.java:179
↓ 11 callersMethodcheckElement
(BigDecimal index, BigDecimal expected)
src/test/java/com/thealgorithms/maths/FibonacciJavaStreamsTest.java:63
↓ 11 callersMethodcontainsKey
()
src/test/java/com/thealgorithms/datastructures/hashmap/hashing/HashMapCuckooHashingTest.java:31
↓ 11 callersMethoddecodeToString
Decodes the given Base64 encoded string to a string using UTF-8 encoding. @param input the Base64 encoded string to decode @return the decoded string
src/main/java/com/thealgorithms/conversions/Base64.java:172
↓ 11 callersMethodfind
Performs iterative binary search on a sorted array. @param array the sorted array @param key the element to search @param <T> type of elements (must
src/main/java/com/thealgorithms/searches/IterativeBinarySearch.java:34
↓ 11 callersMethodfindMinimumSpanningArborescence
Computes the total weight of the Minimum Spanning Arborescence of a directed, weighted graph from a given root. @param numVertices the number of vert
src/main/java/com/thealgorithms/graph/Edmonds.java:70
↓ 11 callersMethodgenerateCodes
Generates Huffman codes for all characters in the tree. @param root root node of the Huffman tree @return map of characters to their Huffman codes
src/main/java/com/thealgorithms/others/Huffman.java:126
↓ 11 callersMethodget
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key. @param key the key whose associated valu
src/main/java/com/thealgorithms/datastructures/hashmap/hashing/GenericHashMapUsingArrayList.java:93
↓ 11 callersMethodgetKey
Gets the key associated with this node. @return the key associated with this node
src/main/java/com/thealgorithms/datastructures/hashmap/hashing/HashMap.java:264
↓ 11 callersMethodgetPriority
()
src/main/java/com/thealgorithms/devutils/entities/ProcessDetails.java:44
↓ 11 callersMethodgetProcessId
()
src/main/java/com/thealgorithms/devutils/entities/ProcessDetails.java:24
↓ 11 callersMethodgetReal
Returns the real part of the complex number. @return The real part of the complex number.
src/main/java/com/thealgorithms/maths/FFT.java:55
↓ 11 callersMethodgetSum
(int start, int end)
src/main/java/com/thealgorithms/datastructures/trees/SegmentTree.java:75
↓ 11 callersMethodhashCode
Returns a hash code value for the heap element. @return a hash code value for this heap element
src/main/java/com/thealgorithms/datastructures/heaps/HeapElement.java:163
↓ 11 callersMethodisFibonacciNumber
Check if a number is a Fibonacci number. This is true if and only if at least one of 5x^2+4 or 5x^2-4 is a perfect square @param number the number @r
src/main/java/com/thealgorithms/maths/FibonacciNumberCheck.java:44
↓ 11 callersMethodisFull
Checks if the circular buffer is full. The buffer is considered full when its size equals its capacity. @return {@code true} if the buffer is full, {
src/main/java/com/thealgorithms/datastructures/buffers/CircularBuffer.java:52
↓ 11 callersMethodisSociable
Checks whether a number is part of a sociable cycle of a given length. Starting from the given number, it follows the chain of proper divisor sums and
src/main/java/com/thealgorithms/maths/SociableNumber.java:54
↓ 11 callersMethodisValid
Checks if the given string has valid parentheses @param s the input string containing parentheses @return true if valid, false otherwise
src/main/java/com/thealgorithms/stacks/ValidParentheses.java:43
↓ 11 callersMethodmergeKList
Merges K sorted linked lists into a single sorted linked list. <p>This method uses a priority queue (min-heap) to repeatedly extract the smallest nod
src/main/java/com/thealgorithms/datastructures/lists/MergeKSortedLinkedList.java:41
↓ 11 callersMethodnewNodePQ
()
src/test/java/com/thealgorithms/datastructures/heaps/IndexedPriorityQueueTest.java:68
↓ 11 callersMethodnext
(int layer)
src/main/java/com/thealgorithms/datastructures/lists/SkipList.java:240
↓ 11 callersMethodpollLast
Removes and returns the last (tail) value in the deque @return the value of the tail of the deque @throws NoSuchElementException if the deque is empt
src/main/java/com/thealgorithms/datastructures/queues/Deque.java:100
↓ 11 callersMethodpush
Pushes an element onto the top of the stack. Resizes the stack if it is full. @param value the element to push
src/main/java/com/thealgorithms/datastructures/stacks/StackArray.java:51
↓ 11 callersMethodput
Returns a new ImmutableHashMap with the given key-value pair added. @param key key to add @param value value to associate @return new ImmutableHashMa
src/main/java/com/thealgorithms/datastructures/hashmap/hashing/ImmutableHashMap.java:47
↓ 11 callersMethodquery
Recursively queries the sum in a submatrix.
src/main/java/com/thealgorithms/datastructures/trees/SegmentTree2D.java:172
↓ 11 callersMethodsolovayStrassen
Performs the Solovay-Strassen primality test on a given number. @param num the number to be tested for primality @param iterations the number of iter
src/main/java/com/thealgorithms/maths/SolovayStrassenPrimalityTest.java:108
↓ 11 callersMethodstepRK4
Performs one time step using the RK4 method. @param state the current state [theta, omega] @param dt the time step size @return the new state after t
src/main/java/com/thealgorithms/physics/SimplePendulumRK4.java:57
↓ 11 callersMethodsum
Computes the sum of two binary characters and a carry. @param a First binary character ('0' or '1'). @param b Second binary character ('0' or '1'). @p
src/main/java/com/thealgorithms/greedyalgorithms/BinaryAddition.java:16
↓ 11 callersMethodsumRange
Calculates the sum of elements in the range [left, right]. Indices are 0-based. @param left The starting index (inclusive). @param right The ending
src/main/java/com/thealgorithms/prefixsum/PrefixSum.java:48
↓ 11 callersMethodtoList
(FlattenMultilevelLinkedList.Node head)
src/test/java/com/thealgorithms/datastructures/lists/FlattenMultilevelLinkedListTest.java:19
↓ 10 callersMethodabs
()
src/test/java/com/thealgorithms/maths/FFTTest.java:85
↓ 10 callersMethodaddChild
(Node<T> child)
src/main/java/com/thealgorithms/datastructures/Node.java:25
↓ 10 callersMethodapproximatePi
This function uses the points in a given list (drawn at random) to return an approximation of the number π. @param pts List of points where each poin
src/main/java/com/thealgorithms/maths/PiApproximation.java:44
↓ 10 callersMethodapproximatelyEqualHsv
(double[] hsv1, double[] hsv2)
src/main/java/com/thealgorithms/conversions/RgbHsvConversion.java:123
↓ 10 callersMethodbinaryStringToDecimal
Converts a binary String to its decimal equivalent using bitwise operators. @param binary The binary number to convert. @return The decimal equivalen
src/main/java/com/thealgorithms/conversions/BinaryToDecimal.java:41
↓ 10 callersMethodbinaryToDecimal
Converts a binary number to its decimal equivalent. @param binaryNumber The binary number to convert. @return The decimal equivalent of the binary nu
src/main/java/com/thealgorithms/conversions/BinaryToDecimal.java:19
↓ 10 callersMethodcheckPalindrome
Check if the string is a palindrome or not. Convert all characters to lowercase and push them into a stack. At the same time, build a string Next, pop
src/main/java/com/thealgorithms/stacks/PalindromeWithStack.java:38
↓ 10 callersMethodcompare
OUTPUT : Input - {89,56,98,123,26,75,12,40,39,68,91} is same for all the 3 classes Output: [12 26 39 40 56 68 75 89 91 98 123] is same for all the 3 c
src/main/java/com/thealgorithms/sorts/LinkListSort.java:126
↓ 10 callersMethodconvertTime
Converts a time value from one unit to another. @param timeValue the numeric value of time to convert; must be non-negative @param unitFrom the unit
src/main/java/com/thealgorithms/conversions/TimeConverter.java:73
↓ 10 callersMethodconvexHullRecursive
Computes the convex hull using a recursive divide-and-conquer approach. Returns points in counter-clockwise order starting from the bottom-most, left-
src/main/java/com/thealgorithms/geometry/ConvexHull.java:71
↓ 10 callersMethodfastExponentiation
Performs fast exponentiation to calculate (base^exp) % mod using the method of exponentiation by squaring. <p>This method efficiently computes the re
src/main/java/com/thealgorithms/maths/FastExponentiation.java:42
↓ 10 callersMethodfind
Finds the index of the specified key in a sorted array using Fibonacci search. @param array The sorted array to search. @param key The element to sea
src/main/java/com/thealgorithms/searches/FibonacciSearch.java:30
↓ 10 callersMethodfind
Finds the index of the specified key in a sorted array using interpolation search. @param array The sorted array to search. @param key The value to s
src/main/java/com/thealgorithms/searches/InterpolationSearch.java:31
↓ 10 callersMethodfind
To check if given value is present in tree or not. @param data the data to be found for
src/main/java/com/thealgorithms/datastructures/trees/BSTRecursiveGeneric.java:339
↓ 10 callersMethodfindEulerianPath
Finds an Eulerian Path or Circuit using Hierholzer’s Algorithm. @return list of vertices representing the Eulerian Path/Circuit, or an empty
src/main/java/com/thealgorithms/graph/HierholzerEulerianPath.java:105
↓ 10 callersMethodgeometric
Computes the geometric mean of the given numbers. <p> The geometric mean is calculated as: ⁿ√(x₁ × x₂ × ... × xₙ) </p> <p> Example: For numbers [2, 8]
src/main/java/com/thealgorithms/maths/Means.java:76
↓ 10 callersMethodget
(int index)
src/main/java/com/thealgorithms/datastructures/lists/SkipList.java:99
↓ 10 callersMethodgetCorrectMess
Returns the counter correctMess @return correctMess, the number of the Correct Messages
src/main/java/com/thealgorithms/others/CRCAlgorithm.java:92
↓ 10 callersMethodgetKey
()
src/main/java/com/thealgorithms/datastructures/heaps/FibonacciHeap.java:404
↓ 10 callersMethodgetNthFrizzy
Returns the n-th number that is a sum of powers of the given base. Example: base = 3 and n = 4 Ascending order of sums of powers of 3 = 3^0 = 1, 3^1 =
src/main/java/com/thealgorithms/maths/FrizzyNumber.java:23
↓ 10 callersMethodgetPrimeSum
(int number)
src/main/java/com/thealgorithms/maths/GoldbachConjecture.java:18
↓ 10 callersMethodgetRoot
Returns the root of the Binary Tree @return the root of the Binary Tree
src/main/java/com/thealgorithms/datastructures/trees/BinaryTree.java:252
↓ 10 callersMethodhsvToRgb
Conversion from the HSV-representation to the RGB-representation. @param hue Hue of the color. @param saturation Saturation of the color. @param valu
src/main/java/com/thealgorithms/conversions/RgbHsvConversion.java:58
↓ 10 callersMethodinverseTransform
Performs the inverse Burrows-Wheeler Transform using the LF-mapping technique. <p> The LF-mapping (Last-First mapping) is an efficient method to recon
src/main/java/com/thealgorithms/compression/BurrowsWheelerTransform.java:171
↓ 10 callersMethodisArmstrong
Checks whether a given number is an Armstrong number or not. @param number the number to check @return {@code true} if the given number is an Armstro
src/main/java/com/thealgorithms/maths/Armstrong.java:23
↓ 10 callersMethodisDisarium
Checks if a number is a Disarium number. @param number the number to check (must be positive) @return true if number is Disarium, false otherwise @th
src/main/java/com/thealgorithms/maths/DisariumNumber.java:22
↓ 10 callersMethodisFull
Returns true if the queue is full. @return True if the queue is full.
src/main/java/com/thealgorithms/datastructures/queues/Queue.java:120
↓ 10 callersMethodisPairedSum
Checks whether there exists a pair of elements in a sorted array whose sum equals the specified key. @param arr a sorted array of integers in ascendi
src/main/java/com/thealgorithms/others/TwoPointers.java:23
↓ 10 callersMethodisPerfectCube
Check if a number is perfect cube or not @param number number to check @return {@code true} if {@code number} is perfect cube, otherwise {@code false
src/main/java/com/thealgorithms/maths/PerfectCube.java:17
↓ 10 callersMethodisPerfectCubeMathCbrt
Check if a number is perfect cube or not by using Math.cbrt function @param number number to check @return {@code true} if {@code number} is perfect
src/main/java/com/thealgorithms/maths/PerfectCube.java:30
↓ 10 callersMethodisPresent
Checks if a vertex is already part of the current Hamiltonian path. @param vertex The vertex to check. @return {@code true} if the vertex is already
src/main/java/com/thealgorithms/datastructures/graphs/HamiltonianCycle.java:98
↓ 10 callersMethodlongestCommonSubstring
Finds the longest common substring of two strings. @param a First input string @param b Second input string @return The longest common substring, or
src/main/java/com/thealgorithms/strings/LongestCommonSubstring.java:27
↓ 10 callersMethodlookup
Checks if an element is in the LWWElementSet. An element is considered present if it exists in the addSet and either does not exist in the removeSet,
src/main/java/com/thealgorithms/datastructures/crdt/LWWElementSet.java:68
↓ 10 callersMethodminiMax
Returns the optimal score assuming that both players play their best. <p> This method recursively evaluates the game tree using the minimax algorithm
src/main/java/com/thealgorithms/others/MiniMaxAlgorithm.java:102
↓ 10 callersMethodpeek
Returns the next character
src/main/java/com/thealgorithms/io/BufferedReader.java:88
← previousnext →301–400 of 8,444, ranked by callers