Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/TypeScript
/ functions
Functions
286 in github.com/TheAlgorithms/TypeScript
⨍
Functions
286
◇
Types & classes
56
↓ 105 callers
Method
push
(data: T)
data_structures/list/linked_list.ts:7
↓ 38 callers
Method
set
(key: K, value: V)
data_structures/map/map.ts:8
↓ 27 callers
Function
test
(func: (n: number) => number)
maths/test/fibonacci.test.ts:7
↓ 24 callers
Method
enqueue
(item: T)
data_structures/queue/queue.ts:2
↓ 19 callers
Function
add_edge
( graph: [number, number][][], a: number, b: number, weight: number )
graph/test/johnson.test.ts:12
↓ 18 callers
Function
add_edge
( graph: [number, number][][], a: number, b: number, weight: number )
graph/test/dijkstra.test.ts:12
↓ 18 callers
Function
add_edge
( graph: [number, number][][], a: number, b: number, weight: number )
graph/test/bellman_ford.test.ts:12
↓ 18 callers
Method
isEmpty
()
data_structures/queue/queue.ts:5
↓ 16 callers
Function
tarjan
(graph: number[][])
graph/tarjan.ts:11
↓ 15 callers
Function
kosajaru
(graph: number[][])
graph/kosajaru.ts:64
↓ 14 callers
Method
pop
()
data_structures/list/linked_list.ts:8
↓ 13 callers
Method
find
* Searches for a word in the Trie. * * @param word - The word to search for. * @param isPrefixMatch - Indicates whether to perform a prefix m
data_structures/tries/tries.ts:49
↓ 13 callers
Method
get
(index: number)
data_structures/list/linked_list.ts:6
↓ 12 callers
Method
add
(value: K)
data_structures/set/set.ts:6
↓ 10 callers
Function
QuickSelect
( array: number[], k: number, left: number = 0, right: number = array.length - 1 )
sorts/quick_select.ts:13
↓ 10 callers
Method
get
(key: K)
data_structures/map/map.ts:9
↓ 10 callers
Method
increasePriority
(idx: number, value: T)
data_structures/heap/heap.ts:187
↓ 9 callers
Method
insert
(value: T)
data_structures/heap/heap.ts:173
↓ 9 callers
Method
length
()
data_structures/queue/queue.ts:6
↓ 8 callers
Function
bellmanFord
( graph: [number, number][][], start: number )
graph/bellman_ford.ts:12
↓ 8 callers
Function
isLeapYear
(year: number)
maths/is_leap_year.ts:12
↓ 8 callers
Function
johnson
( graph: [number, number][][] )
graph/johnson.ts:14
↓ 7 callers
Method
find
* Find the representative index for an element
data_structures/disjoint_set/disjoint_set.ts:33
↓ 7 callers
Function
getWeekday
( year: number, month: number, day: number, calendar: Calendar = Calendar.Gregorian )
maths/zellers_congruence.ts:17
↓ 7 callers
Function
longestCommonSubsequence
( text1: string, text2: string )
dynamic_programming/lcs.ts:8
↓ 6 callers
Function
addBinary
( firstBinaryNo: string, secondBinaryNo: string )
bit_manipulation/add_binary.ts:8
↓ 6 callers
Method
append
(data: T)
data_structures/list/linked_list.ts:9
↓ 6 callers
Function
binaryConvert
(num: number)
maths/binary_convert.ts:11
↓ 6 callers
Function
binaryLCM
(a: number, b: number)
maths/lowest_common_multiple.ts:42
↓ 6 callers
Method
extract
()
data_structures/heap/heap.ts:178
↓ 6 callers
Function
factorial
(num: number)
maths/factorial.ts:10
↓ 6 callers
Function
init_graph
(N: number)
graph/test/johnson.test.ts:4
↓ 6 callers
Method
insert
* Inserts the given data into the binary search tree. * * @param data The data to be stored in the binary search tree. * @returns
data_structures/tree/binary_search_tree.ts:86
↓ 6 callers
Method
join
* Join two sets
data_structures/disjoint_set/disjoint_set.ts:44
↓ 5 callers
Function
absoluteValue
(number: number)
maths/absolute_value.ts:12
↓ 5 callers
Function
calculateMean
(numbers: number[])
maths/calculate_mean.ts:11
↓ 5 callers
Function
dijkstra
( graph: [number, number][][], start: number )
graph/dijkstra.ts:13
↓ 5 callers
Function
edmondsKarp
( graph: [number, number][][], source: number, sink: number )
graph/edmonds_karp.ts:15
↓ 5 callers
Function
extract_all
(heap: MaxHeap<number>)
data_structures/heap/test/heap.test.ts:33
↓ 5 callers
Function
floydWarshall
(graph: number[][])
graph/floyd_warshall.ts:11
↓ 5 callers
Function
init_graph
(N: number)
graph/test/bellman_ford.test.ts:3
↓ 5 callers
Function
isBipartite
(graph: number[][])
graph/bipartite_graph.ts:33
↓ 5 callers
Method
isSame
* Check whether two elements are in the same set
data_structures/disjoint_set/disjoint_set.ts:67
↓ 5 callers
Method
length
* @function length * @description - number of elements in the stack * @return {number} the number of elements in the stack
data_structures/stack/stack.ts:51
↓ 5 callers
Method
peek
()
data_structures/queue/queue.ts:4
↓ 5 callers
Function
perfectSquare
(num: number)
maths/perfect_square.ts:9
↓ 5 callers
Method
top
* @function top * @description - return the last element in the stack without removing it * @return {T | null} return the last element or null i
data_structures/stack/stack.ts:69
↓ 4 callers
Method
dequeue
()
data_structures/queue/queue.ts:3
↓ 4 callers
Method
has
(key: K)
data_structures/map/map.ts:11
↓ 4 callers
Method
hash
* Hashes a key to an index. * This implementation uses the djb2 algorithm, which might not be the best. * Feel free to change it to something el
data_structures/map/hash_map.ts:198
↓ 4 callers
Method
isEmpty
* Checks, if the list is empty. * * @returns Whether the list is empty or not.
data_structures/list/singly_linked_list.ts:47
↓ 4 callers
Function
kruskal
( edges: Edge[], num_vertices: number )
graph/kruskal.ts:14
↓ 4 callers
Function
prim
(graph: [number, number][][])
graph/prim.ts:12
↓ 4 callers
Function
test_graph
( expected_tree_edges: Edge[], other_edges: Edge[], num_vertices: number, expected_cost: number )
graph/test/kruskal.test.ts:3
↓ 3 callers
Function
HeapSort
(arr: number[])
sorts/heap_sort.ts:15
↓ 3 callers
Function
HexagonalNumbers
(n: number)
maths/series/hexagonal_numbers.ts:17
↓ 3 callers
Function
QuickSort
( array: number[], left: number = 0, right: number = array.length - 1 )
sorts/quick_sort.ts:61
↓ 3 callers
Function
binaryGCF
(a: number, b: number)
maths/greatest_common_factor.ts:12
↓ 3 callers
Function
bubbleSort
(arr: number[])
sorts/bubble_sort.ts:20
↓ 3 callers
Function
calculateMedian
(numbers: number[])
maths/calculate_median.ts:11
↓ 3 callers
Function
cycleSort
(array: number[])
sorts/cycle_sort.ts:10
↓ 3 callers
Function
degreesToRadians
(degrees: number)
maths/degrees_to_radians.ts:9
↓ 3 callers
Function
gaussianElimination
(matrix: number[][])
maths/gaussian_elimination.ts:7
↓ 3 callers
Method
getLength
()
data_structures/list/linked_list.ts:15
↓ 3 callers
Function
greatestCommonFactor
(nums: number[])
maths/greatest_common_factor.ts:23
↓ 3 callers
Function
init_graph
(N: number)
graph/test/dijkstra.test.ts:4
↓ 3 callers
Function
insertionSort
(arr: number[])
sorts/insertion_sort.ts:10
↓ 3 callers
Function
isDivisible
(num1: number, num2: number)
maths/is_divisible.ts:11
↓ 3 callers
Method
isEmpty
()
data_structures/list/linked_list.ts:5
↓ 3 callers
Function
isPrime
(num: number)
maths/primes.ts:70
↓ 3 callers
Method
keys
()
data_structures/map/map.ts:13
↓ 3 callers
Function
lowestCommonMultiple
(nums: number[])
maths/lowest_common_multiple.ts:46
↓ 3 callers
Function
matrixMultiplication
( matA: number[][], b: any )
maths/matrix_multiplication.ts:16
↓ 3 callers
Function
naiveLCM
(nums: number[])
maths/lowest_common_multiple.ts:16
↓ 3 callers
Function
radiansToDegrees
(radians: number)
maths/radians_to_degrees.ts:9
↓ 3 callers
Method
reverse
* Reverses the list. * Time complexity: O(n) * * @returns The reversed list or null if the list is empty.
data_structures/list/doubly_linked_list.ts:219
↓ 3 callers
Function
shellSort
(arr: T[])
sorts/shell_sort.ts:16
↓ 3 callers
Method
shift
* Shifts the elements from the enqueueStack to the dequeueStack * In the worst case, all the elements from the enqueue stack needs to shifted, whic
data_structures/queue/stack_queue.ts:50
↓ 3 callers
Function
shuffleArray
(arr: number[])
other/shuffle_array.ts:1
↓ 3 callers
Function
squareRoot
(num: number, precision: number = 1e-15)
maths/square_root.ts:12
↓ 3 callers
Function
testQueue
(Queue: QueueConstructor)
data_structures/queue/test/queue.ts:4
↓ 3 callers
Function
treeSort
(arr: T[])
sorts/tree_sort.ts:12
↓ 3 callers
Method
values
()
data_structures/map/map.ts:14
↓ 2 callers
Function
CountSmallerItems
( array: number[], startIndex: number, currentItem: number )
sorts/cycle_sort.ts:42
↓ 2 callers
Function
SkipDuplicates
( array: number[], currentPosition: number, currentItem: number )
sorts/cycle_sort.ts:58
↓ 2 callers
Function
XORCipher
(str: string, key: number)
ciphers/xor_cipher.ts:12
↓ 2 callers
Function
add_children
( graph: [number, number][][], priorityQueue: PriorityQueue<Edge>, node: number )
graph/prim.ts:49
↓ 2 callers
Function
binomialCoefficient
(n: number, k: number)
maths/binomial_coefficient.ts:14
↓ 2 callers
Method
delete
(key: K)
data_structures/map/map.ts:10
↓ 2 callers
Function
digitSum
(num: number)
maths/digit_sum.ts:11
↓ 2 callers
Function
edge_equal
(x: Edge, y: Edge)
graph/test/prim.test.ts:3
↓ 2 callers
Method
enqueue
* Adds an item to the queue. * We always add a new item to the enqueueStack. * @param item The item being added to the queue.
data_structures/queue/stack_queue.ts:40
↓ 2 callers
Function
findFactors
(num: number)
maths/factors.ts:11
↓ 2 callers
Function
findMin
(nums: number[])
maths/find_min.ts:12
↓ 2 callers
Method
getSize
()
data_structures/map/map.ts:7
↓ 2 callers
Method
has
(value: K)
data_structures/set/set.ts:8
↓ 2 callers
Function
heapify
(arr: number[], index: number, size: number)
sorts/heap_sort.ts:36
↓ 2 callers
Method
inOrderTraversal
* Traverses to the binary search tree in in-order, i. e. it follow the schema of: * Left Node -> Root Node -> Right Node * * @param array The
data_structures/tree/binary_search_tree.ts:153
↓ 2 callers
Method
initializeBuckets
* Initializes the buckets. * * @param amount The amount of buckets to initialize.
data_structures/map/hash_map.ts:183
↓ 2 callers
Method
isEmpty
* Checks if the queue is empty. * * @returns {boolean} Whether the queue is empty or not.
data_structures/queue/array_queue.ts:25
next →
1–100 of 286, ranked by callers