Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
265 commits
Select commit Hold shift + click to select a range
baa09a6
Fibonacci_Number using DP approach added (#2060)
ravireddy07 Mar 19, 2020
c726b74
Length of Linked List in C, Java Added
ravireddy07 Mar 19, 2020
33a784f
Implemented the Gnome Sort Completely. (#2275)
srimanikantapalakollu Mar 19, 2020
b4e89f3
Merge_Sort.php added (#1820)
goyalmuskan Mar 19, 2020
0b5d39b
Implementation of Karatsuba Algorithm in JS (#2420)
abhushanaj Mar 19, 2020
feb06a5
Create Shell_Sort.cs (#2457)
Harikrishnan6336 Mar 19, 2020
8500747
Finding last digit of nth term in squares of fibonacci number (#2285)
RohitVarma001 Mar 19, 2020
564d1fd
Added minesweeper implementation in C++ (#2541)
chandrikadeb7 Mar 19, 2020
fa99a78
LCM of N elements of an array
ritish099 Mar 19, 2020
b13b244
Added Longest Increasing Subsequence code in Go (#2493)
Mar 20, 2020
6d249f8
added ruby implementation of Armstrong number (#2501)
sparkingdark Mar 20, 2020
81efff3
Postfix Evaluation in C
HariniJeyaraman Mar 20, 2020
a771bf1
Max_circular_sum_added (#2354)
MdAkdas Mar 21, 2020
3ec54db
Ternary Search in C# (#2176) (#2494)
p-soham11 Mar 21, 2020
03077e5
Create arrayList.java (#2230)
simrankoul Mar 22, 2020
4d56308
palindromic_string_added 2, indentation fixed C/C++ (#2356)
MdAkdas Mar 23, 2020
cda8049
check palindrome in a number in Java (#2492)
raksha009 Mar 24, 2020
b02279f
check palindrome in a string in Java (#2491)
raksha009 Mar 24, 2020
c91c9a8
Added code for Tower Of Hanoi in Go language (#2562)
rbjoshi1309 Mar 25, 2020
1a7ceec
Merge-sort-3-way-with-reuested-changes (#2505)
abhinashgiri Mar 25, 2020
3bb864c
Created Count_Rotations.java (#1804)
ishaan2908 Mar 25, 2020
b5a3f73
Integer to Roman Program (#2216)
wolfgunblood Mar 25, 2020
0cfac2b
Depth First Search in Dart (#2561)
Rukmini-Meda Mar 27, 2020
d3a2320
Breadth first search using dart (#2560)
Rukmini-Meda Mar 27, 2020
e492e1a
Postman Sort in C# (#2511)
ritish099 Mar 27, 2020
5730c44
CircleSort Algo in Kotlin (#2460)
myselfanuj Mar 27, 2020
8c338af
added armstrong in c#
BishalKrChanda Mar 27, 2020
32a2237
Implemented KNN algorithm using C++ (Closes issue #1789) (#2546)
Aman-Codes Mar 27, 2020
db7a66f
Binary Tree Bottom View, Top View and Right View in C #1577 (#2396)
AkanshaKamboj Mar 27, 2020
e3e7af5
Tower of Hanoi in Kotlin (#2531)
chandb5 Mar 28, 2020
a9e22d6
Added Tower Of Hanoi in PHP (#2577)
chandrikadeb7 Mar 28, 2020
51b497c
Tower of Hanoi in Dart (#2513)
disha2sinha Mar 28, 2020
775b4ae
added kadane algo in dart (#2517)
heisastark Mar 28, 2020
c2aa357
Find whether a number is Palindrome or not (#2327)
raksha009 Mar 28, 2020
8f170a6
Jhonson Algorithm in C# (#2626)
ritish099 Mar 29, 2020
df04554
Added Topological_Sort.js (Fixes #2159) (#2369)
JanaSabuj Mar 29, 2020
49d5368
Addition of matrix in java (#2527)
raksha009 Mar 29, 2020
39bbc04
Priority_Queue.py
VIJAY07102 Mar 30, 2020
f47d1b7
Added implementation of Z-Algorithm in JS (#2607)
abhushanaj Mar 31, 2020
faf814b
Created Pancake Sort in C# (#2309)
himanshusharma89 Apr 1, 2020
23261ce
Create Tree_Preorder_Traversal.kt (#2585)
PrachieNaik Apr 1, 2020
94f3379
add kosaraju algorithm in cpp (#2672)
pragyajaiswa05l Apr 1, 2020
2e9f2ac
Aggressive cows (#2543)
j-shreya Apr 1, 2020
4a4737d
Logistic Regression in Python (#2636)
shreyakapoor08 Apr 2, 2020
fb37ab4
Johnson Algorithm Implementation in Dart (#2567)
Swarnimashukla Apr 2, 2020
4e69094
Boyer Moore Algorithm in C# (#2604)
HardevKhandhar Apr 2, 2020
f231d7f
Adding PHP Implementation for Chinese Rem. Th. (#2685)
sukritishah15 Apr 3, 2020
50193d0
Added Minimum Absolute Difference in Array Problem[C and C++] (#1845)
apoorvam25 Apr 3, 2020
67a6b6b
Count_Inversion.cpp (#2625)
mansikagrawal Apr 3, 2020
34d8d3b
Added Tree Inorder Traversal in JS (#2586)
Aman-Codes Apr 5, 2020
3aa6457
Floyd warshal js (#2468)
prince-09 Apr 5, 2020
f16d95f
Added a Number conversion(Decimal to Binary) code in java (#2524)
LovepreetSingh12 Apr 5, 2020
51ad0a1
Linked list merge sort in C, C++, Java, Python #1578 (#2395)
AkanshaKamboj Apr 5, 2020
b973bac
Chinese Remainder Theorem in Go (#2675)
Apr 5, 2020
16da633
1st commit (#2605)
HariniJeyaraman Apr 6, 2020
983c5d3
Dijkstra Algorithm implementation in dart (#2617)
Swarnimashukla Apr 6, 2020
c45f20b
added selection sort logic in typescript (#2693)
lakshyajit165 Apr 6, 2020
3140991
Tower Of Hanoi In Ruby (#2701)
HardevKhandhar Apr 7, 2020
971acfb
Add Inorder Traversal in Kotlin (#2657)
sandhyabhan Apr 9, 2020
6019d81
README FOR FORD FULKERSON METHOD (#2589)
syedareehaquasar Apr 9, 2020
8d30245
Kadane Algorithm (#2534)
kushagra-anand Apr 10, 2020
d3d50a9
Boyer Moore Algo in c added (#2644)
ravireddy07 Apr 10, 2020
fe9be76
Boyer Moore in Go (#2687)
Apr 10, 2020
7e65309
Kruskal Algo in C (#2255)
heisenbuggs Apr 12, 2020
0f3e0fb
Breadth First Search in Ruby (#2635)
HardevKhandhar Apr 12, 2020
b21a0ea
Tree Inorder Traversal In C# (#2723)
HardevKhandhar Apr 13, 2020
5f10bda
Adding Backtracking Using Bitmasking (#2583)
RiaJha02 Apr 13, 2020
9dbe42b
Transpose of matrix in java (#2529)
raksha009 Apr 14, 2020
335ca72
Kruskal Algorithm Implementation in python (#2682)
Manish-cloud Apr 14, 2020
1d8912a
Tree Preorder Traversal in Dart (#2720)
Rukmini-Meda Apr 14, 2020
007b6f9
Added Karatsuba Algo in Dart (#2616)
heisastark Apr 14, 2020
8f5692e
corrected indentation in shell sort using go (#2683)
lakshyajit165 Apr 14, 2020
3188f22
README.md for Z-ALGORITHM (#2594)
syedareehaquasar Apr 15, 2020
4386283
:star: add median of two sorted arrays (#2463)
ashishnagpal2498 Apr 15, 2020
ae9770f
Segment tree RMQ in C added. (#2676)
MdAkdas Apr 16, 2020
9ebc24f
Depth First Search in C# (#2674)
shreyakapoor08 Apr 17, 2020
237d3de
Added code of Longest Increasing Subsequence in Java (#2598)
rbjoshi1309 Apr 17, 2020
aa64927
AVL Tree implementation in C++ (#2679)
Manish-cloud Apr 17, 2020
83c8169
PHP implementation for LIS (#2669)
sukritishah15 Apr 17, 2020
f68d36e
Prims Algorithm in C (#2684)
ritish099 Apr 17, 2020
0e73cbf
Jhonson Algorithm in PHP (#2696)
ritish099 Apr 17, 2020
329ca74
Fenwick_Tree.php Added (#2689)
goyalmuskan Apr 18, 2020
85f7d36
Tree Level order Traversal Tree (#2642)
ashishnagpal2498 Apr 19, 2020
b5e7b15
bfs in Csharp added (#2514)
prashansag62 Apr 19, 2020
ffa64bf
Chinese Remainder Theorem in Dart (#2763)
Rukmini-Meda Apr 20, 2020
7cd7f84
Johnson Algorithm implementation in C (#2334)
ka1shi Apr 21, 2020
d07d86e
Add Level Order Traversal in Kotlin (#2757)
sandhyabhan Apr 23, 2020
a4052fb
Add spiral array in C (#2322)
sandhyabhan Apr 23, 2020
3d4de05
Added LCS implementation in Ruby (#2252) (#2766)
Tahanima Apr 25, 2020
6a9acfe
Merge Sort in Rust (#2760)
m-code12 Apr 25, 2020
30a9f39
Created Ternary_Search.kt (#2745)
saloniankita Apr 25, 2020
e43cc39
added PHP/Heap sort (#2147) (#2737)
anmolkaur18 Apr 26, 2020
85d70e5
Bucket Sort in Ruby (#2759)
m-code12 Apr 28, 2020
8ca15ba
Topological Sort implemented in Dart (#2812)
Rukmini-Meda Apr 28, 2020
19c851e
Implementation Of Tower of Hanoi in C# (#2599)
victoryTech Apr 29, 2020
e6e79ba
Insertion Sort #2148 (#2806)
debdutgoswami Apr 29, 2020
f6ca8c2
Segment Tree RMQ implemented in Dart (#2799)
Rukmini-Meda Apr 29, 2020
3588067
Added Chinese remainder theorem in C. (#2832)
Anushka-Rajvanshi Apr 30, 2020
1457fe4
Gray Code generation of any input bit length (#2005)
SubhradeepSS May 1, 2020
bcccc63
Karatsuba Algorithm In GO (#2817)
HardevKhandhar May 1, 2020
565a6e8
Postman sort readme added (#2829)
shwetagurnani May 2, 2020
8f33b4e
Added Boyer_Moore_Algorithm in Kotlin (#2813)
darkmatter18 May 2, 2020
1e9cf08
'c++_implementation_of_RSA_CRT' (#2724)
muskanjaiswal10 May 2, 2020
e5f9fda
'Python_Implementation_of_Rabin_Karp' (#2728)
muskanjaiswal10 May 2, 2020
1f212dd
implementation dijkstra algo in ts (#2732)
BhuwanChandra May 2, 2020
df1e034
Floyd Warshall Algorithm In Ruby (#2758)
HardevKhandhar May 2, 2020
99c7851
Linear Search in dart language (#2838)
keshakaneria May 2, 2020
3e91af4
Linear Search in dart language (#2410)
keshakaneria May 3, 2020
2c2d0bb
Depth First Search in Go (#2818)
m-code12 May 3, 2020
7f0ec41
Qsort in kotlin (#2831)
97shivank May 3, 2020
9dc9e66
Added Postman Sort in JavaScript (#2729)
heisenbuggs May 3, 2020
553c775
Matrix_identical in java (#2750)
raksha009 May 3, 2020
9819cdb
Binary search in dart language (#2411)
keshakaneria May 3, 2020
80216a4
KMP Algorithm in JavaScript is added (#2801)
bohemian98 May 4, 2020
fbf8ee5
Updated Decimal_to_Binary.cpp (#2862)
May 4, 2020
90c61a0
Update Longest_Common_Subsequence.php (#2815)
thakran14 May 4, 2020
ad27788
Multiplication in java (#2856)
raksha009 May 5, 2020
a67cc02
Created Shell_Sort.php (#2772)
saloniankita May 6, 2020
7631ddb
Updated Prim's Algorithm in JS (#2835)
sukritishah15 May 6, 2020
41604ec
adding c file of fenwick tree
santushtisharma10 May 8, 2020
ba243da
Subtraction of matrix in java (#2528)
raksha009 May 8, 2020
2f8a66f
KMP algorithm in dart added (#2852)
disha2sinha May 8, 2020
03e3e33
Added Selection_Sort.php (#2272)
BhardwajShweta25 May 9, 2020
9d417bb
Matrix_intersection in java (#2877)
raksha009 May 10, 2020
da4a40a
Create Readme.md (#2843)
chandrikadeb7 May 10, 2020
35097a3
Readme for Segment_Tree_RMQ (#2841)
chandrikadeb7 May 10, 2020
c49739c
squashingthecommits (#2827)
mruna7 May 10, 2020
1c7f472
Kosraju Algorithm in C# (#2834)
ritish099 May 10, 2020
b58f319
Z Algorithm in Rust (#2677)
May 10, 2020
7f37548
Create Readme.md (#2480) (#2888)
simrann20 May 11, 2020
48c5628
Go implementation of Heap Sort (#2884)
Shr03mink May 12, 2020
24c52a8
Added Knuth Morris Pratt Algorithm in Kotlin (#2814)
darkmatter18 May 12, 2020
ad5c987
Added KMP implementation in Ruby (#2555) (#2848)
Tahanima May 12, 2020
6b87d35
Update Depth_First_Search.php (#2876)
thakran14 May 12, 2020
da0c596
introsort.py added in new folder named Intro_Sort (#2895)
jyotijauhari May 13, 2020
9c3e46f
Generic tree (#2365)
j-shreya May 13, 2020
5021c39
Rabin Karp in C (#2844)
disha2sinha May 13, 2020
8b7e6fe
Kosaraju readme added (#2920)
shwetagurnani May 15, 2020
44121a0
Create README.md (#2822)
Amitsharma45 May 15, 2020
8a26220
Bucket_Sort in go (#2898)
m-code12 May 15, 2020
a675575
Red Black Tree implementation in C# (#2924)
ritish099 May 15, 2020
ffb5a2c
AVL Tree implemented in Dart (#2914)
Rukmini-Meda May 17, 2020
419e8fd
Jhonson Algorithm in Kotlin (#2925)
ritish099 May 18, 2020
237ffce
Z Algorithm In C# (#2900)
HardevKhandhar May 18, 2020
4b231dc
Circle Sort In Ruby (#2896)
HardevKhandhar May 18, 2020
055a103
Added Postman Sort in JavaScript (#2901)
heisenbuggs May 18, 2020
2c7a046
Create Pancake_Sort.go (#2928)
KamalDGRT May 19, 2020
57b6134
Bubble Sort in Rust (#2899)
m-code12 May 19, 2020
3101e39
Merge Sort in Typescript (#2891)
m-code12 May 19, 2020
c8b8ccb
Create Euclidean_Algorithm.c (#2944)
simrann20 May 19, 2020
10c7d52
Add Counting sort in Kotlin (#2902)
sandhyabhan May 19, 2020
f9bbcf1
Selection sort in rust (#2916)
raksha009 May 19, 2020
179d584
Fixed a typo in the code (#2938)
atarax665 May 19, 2020
07e4612
Added Readme (#2794)
kmrakash May 20, 2020
5da2ea8
PHP implementation for Dijkstra's Algorithm (Issue #2204) (#2890)
sukritishah15 May 20, 2020
a04087e
Add files in TypeScript (#2945)
shivanidalmia1203 May 20, 2020
48abee1
Ford Fulkerson in JS(changes made) (#2865)
bohemian98 May 20, 2020
1fcf573
linear search in rust (#2950)
raksha009 May 21, 2020
f4b3b3f
Create Extended_Euclidean_Algorithm.rb (#2949)
atarax665 May 22, 2020
dc117b6
Modified spacing extended euclidean algorithm in java (#2953)
lakshyajit165 May 22, 2020
4f2b73b
Added Exponential Search in PHP (#2957)
thakran14 May 22, 2020
2e71476
Add Aho-Corasick in Python (#2962)
shivanidalmia1203 May 23, 2020
25e6d61
Binary search in rust (#2927)
raksha009 May 24, 2020
d8e3a02
Shell Sort In Ruby (#2969)
HardevKhandhar May 24, 2020
27e8530
Tower_Of_Honoi.ts (#2964)
vyom153069 May 25, 2020
7356f1a
code added (#2967)
Satyam3976 May 25, 2020
2e415ba
Cycle Sort In Ruby (#2970)
HardevKhandhar May 25, 2020
0290290
Updated file (#2989)
shivanidalmia1203 May 25, 2020
a6923fb
Euclidean Algo added (#2966)
Satyam3976 May 25, 2020
7344243
Binary Search in TypeScript (#2941)
Shr03mink May 25, 2020
7b31916
circle_sort.php added (#2919)
mharshita May 26, 2020
14da38d
Adding PHP Implementation for Boyer Moore Algo. (#2968)
sukritishah15 May 26, 2020
1bda334
Sieve_Of_Eratosthenes (#2904)
mruna7 May 27, 2020
b7a3d92
Depth First Search in Kotlin (#2980)
m-code12 May 27, 2020
5367327
Kosaraju Algorithm Implemenation in Kotlin (#2994)
ritish099 May 28, 2020
ec6a8b5
Comb Sort in Kotlin (#2886)
sandhyabhan May 28, 2020
a28af42
Cycle Sort in Go (#2995)
m-code12 May 28, 2020
c188bf4
Pigeonhole Sort in Go (#2984)
m-code12 May 28, 2020
52d9c24
dijkstra algo readme added (#2997)
shwetagurnani May 29, 2020
a87620b
Extended Euclidean Algorithm in PHP (#2988)
utkarshanehe May 29, 2020
0d5be80
Postman sort implemented in Dart (#3001)
Rukmini-Meda May 29, 2020
27d1f42
Added Rabin-Karp implementation in Ruby (#2161) (#2926)
Tahanima May 30, 2020
66a4146
Added Euclidean Algorithm implementation in Ruby (#2905) (#2934)
Tahanima May 30, 2020
95e6ac9
Pigeonhole Sort algorithm using Kotlin (#2960)
Anushka118 May 30, 2020
10d01e2
Added Fenwick_Tree in Kotlin (#2963)
JasbirCodeSpace May 30, 2020
bacdd61
Squashed commits (#2977)
Jitmanew-Tyagi May 30, 2020
777eaa0
Adding Floyd Warshall Algorithm in Kotlin (#2986)
THEBEAST310 May 30, 2020
4084abe
Radix Sort in Rust (#2987)
m-code12 May 30, 2020
f11da2b
Fenwick Tree implementation in C# (#2993)
ritish099 May 30, 2020
6640118
Add Euclidean Algorithm in TypeScript (#3000)
shivamgupta57121 May 30, 2020
4d34cfd
Radix Sort in PHP (#3006)
vedangi163 May 30, 2020
8614656
:star: kosaraju algorithm in JS (#2887)
ashishnagpal2498 May 30, 2020
6ce77da
Create Prims_Algorithm.kt (#2713)
darkmatter18 May 30, 2020
3751213
Implemented the Knuth Morris Pattern Matching Algorithm. (#2702)
srimanikantapalakollu May 30, 2020
d736655
Huffman Encoding using C++ STL (#1964)
SubhradeepSS May 30, 2020
ff15d7a
KMP in C (#2828)
shreyakapoor08 May 30, 2020
b9a6fc2
Create pancakesort.js (#2893)
sejalshri May 30, 2020
e7d5458
Added Karatsuba_Algorithm.php (#2910)
JasbirCodeSpace May 30, 2020
b8a12f6
Insertion Sort in Rust (#2983)
m-code12 May 30, 2020
daa21c0
squash (#2483)
shreyakapoor08 May 30, 2020
9172c61
Prims Algorithm implementation in Dart (#2785)
Swarnimashukla May 30, 2020
3aa5ad8
Kruskal Algorithm implementation in Dart (#2786)
Swarnimashukla May 30, 2020
07aa1a2
Srtf Scheduling (#2482)
vishakha2108 May 30, 2020
cd4520d
README for Longest Increasing Subsequence (#2897)
debdutgoswami May 30, 2020
e9587d7
Added Ternary_Search.php (#3025)
BhardwajShweta25 May 30, 2020
400b9ba
3 way quick sort implemented in Dart (#3026)
Rukmini-Meda May 30, 2020
9cd94a2
Linear_Search(Typescript) (#3004)
mruna7 May 30, 2020
eb675af
Create cyclesort.c #2146 (#2807)
sejalshri May 30, 2020
abddc12
Implementation of 0/1 knapsack problem in c++ (updated) (#2433)
shweta0699 May 30, 2020
65529ae
Create Tree_Postorder_Traversal.kt (#2699)
PrachieNaik May 30, 2020
8788995
Fenwick tree implemented in Dart (#3007)
Rukmini-Meda May 30, 2020
b460d6f
Red black tree implemented in Dart (#3009)
Rukmini-Meda May 30, 2020
7a2c24b
Karatsuba Algorithm In Ruby (#3039)
HardevKhandhar May 31, 2020
8751028
Rabin Karp in PHP (#3005)
heisenbuggs May 31, 2020
7932f22
Add Tree Postorder Traversal in TypeScript (#3008)
shivamgupta57121 May 31, 2020
f5ee66d
Create Rabin_karp.js (#3038)
JanaSabuj May 31, 2020
c98def0
Rabin Karp implemented in Dart (#3040)
Rukmini-Meda May 31, 2020
6bb77d8
Cycle sort implemented in Dart (#3041)
Rukmini-Meda May 31, 2020
06ebcbe
Cocktail Sort In Ruby (#3044)
HardevKhandhar May 31, 2020
880e8d6
Sleep Sort in Go (#3045)
m-code12 May 31, 2020
07e48a6
Implementation of preorder traversal in typescript (#3034)
Shr03mink May 31, 2020
5a49922
Counting Sort in Go (#3046)
m-code12 May 31, 2020
622a2d6
selection sort (#3048)
May 31, 2020
9f500f9
Add Sieve Of Eratosthenes in TypeScript (#3010)
shivamgupta57121 May 31, 2020
5de74e2
Add Longest_Increasing_Subsequence in Kotlin (#2935)
sandhyabhan May 31, 2020
b2a5aa4
Radix sort implemented in Dart (#3050)
Rukmini-Meda May 31, 2020
6d986d5
Bellman Ford algorithm implemented in Dart (#2999)
Rukmini-Meda May 31, 2020
36eba55
Kosaraju Algorithm implemented in Dart (#2991)
Rukmini-Meda May 31, 2020
b0db722
Knuth-Morris algo readme (#2948)
raksha009 May 31, 2020
9e6cbdc
Readme for introsort (#3012)
raksha009 May 31, 2020
67ca1a1
Binary Insertion sort in dart (#3013)
raksha009 May 31, 2020
44f5e38
Add Pancake Sort in Kotlin (#2889)
sandhyabhan May 31, 2020
225cf54
Preemptive priority in C++ (#3043)
pratu098 May 31, 2020
dda8e0e
added README for RSA Algorithm issue #2162 (#2918)
mharshita May 31, 2020
d5f9a31
Extended Algorithm README.md (#2990)
Amitsharma45 May 31, 2020
432c23b
Created Pancake Sort in php (#2976)
sakshikhachane May 31, 2020
b378ed9
Quick_Sort in Go (#3055)
m-code12 May 31, 2020
340eff8
Pancake sort implemented in Dart (#3049)
Rukmini-Meda May 31, 2020
8433ec3
Added Ternary_Search.rb (#2921)
atarax665 May 31, 2020
512143d
Create README.md (#2344)
nehasangeetajha May 31, 2020
d62a3a1
Cocktail sort implemented in Dart (#3056)
Rukmini-Meda May 31, 2020
09da3c6
Created Insertion_Sort.php (#2805)
saloniankita May 31, 2020
3934605
Added the README.md file for Exponential Search (#2448)
AjaySharma132 May 31, 2020
386ebef
Primality test implemented in Dart (#3054)
Rukmini-Meda May 31, 2020
0357d28
Implementation of Bead sort in ruby (#2441)
sparkingdark May 31, 2020
8780882
Created Quick_Sort.ts (#3031)
dj373 Jun 4, 2020
1700661
Added implementation of AVL tree in PHP (#2939)
chandrikadeb7 Jun 4, 2020
7029a6d
Create Cycle_Sort.c (#3058)
saloniankita Jun 4, 2020
6033512
Floyd Warshall Algorithm implemented in Dart (#2883)
disha2sinha Jun 4, 2020
b0c11a2
Corrected technical problem in README.md (#3120)
aditdesai Nov 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions AKS_Primarility_Test/AKS.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Importing required libraries
import 'dart:io';

// Function to fill the coefficients array
void coef(int number, List c){
c[0] = 1;
for (int i = 0; i < number; c[0] = -c[0], i ++){
c[i + 1] = 1;
for (int j = i; j > 0; j --){
c[j] = c[j - 1] - c[j];
}
}
}

// Function to find the primality of a given number using AKS primality test
bool aks_primality(int number){
List c = List(100);
coef(number, c);
c[0] ++;
c[number] --;
int i = number;
while ((i --) > 0 && c[i] % number == 0);
return i < 0;
}

// Driver method of the program
void main(){
// Input of the number
print("Enter a number for primality test:");
var input = stdin.readLineSync();
int number = int.parse(input);

// Respective output
if (number > 64){
print("This number is out of scope of this algorithm. This works only till 64");
return;
}
if (aks_primality(number)){
print("It is a prime number");
}
else {
print("It is not a prime number");
}
}

/**
* Sample Input and Output
* ---------------------------------
* Enter a number for primality test:
* 37
* It is a prime number
* Enter a number for primality test:
* 24
* It is not a prime number
*/
202 changes: 202 additions & 0 deletions AVL_Tree/AVL_Tree.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
#include<iostream>
using namespace std;

struct tnode
{
int data;
tnode * L, * R;
tnode()
{
L = R = NULL;
}
};

class AVL
{
private:
tnode * root;
public:
AVL() { root = NULL; }
tnode * LL(tnode *);
tnode * RR(tnode *);
tnode * LR(tnode *);
tnode * RL(tnode *);

int height(tnode *);
int MAX(int, int);

void create();
tnode * insert(tnode *, int);
void display();
void inorder(tnode *);
void preorder(tnode *);
};

tnode * AVL :: LL(tnode * parent)
{
tnode * temp;
temp = parent -> L;
parent -> L = temp -> R;
temp -> R = parent;
return temp;
}

tnode * AVL :: RR(tnode * parent)
{
tnode * temp;
temp = parent -> R;
parent -> R = temp -> L;
temp -> L = parent;
return temp;
}

tnode * AVL :: LR(tnode * parent)
{
parent -> L = RR(parent -> L);
parent = LL(parent);
return parent;
}

tnode * AVL :: RL(tnode * parent)
{
parent -> R = LL(parent -> R);
parent = RR(parent);
return parent;
}

int AVL :: MAX(int a, int b)
{
if(a > b)
return a;
else
return b;
}

int AVL :: height(tnode * temp )
{
if(temp == NULL) //height of empty node(subtree)
return -1;

if(temp -> L == NULL and temp -> R == NULL) //height of leaf node
return 0;

return (1 + MAX( height(temp -> L), height(temp -> R)));
}

void AVL :: create()
{
int val;
char ch;
do
{
cout << "Enter Number : ";
cin >> val;
root = insert(root, val);
cout << "Continue : ";
cin >> ch;
}while(ch == 'y');
}

tnode * AVL :: insert(tnode * temp, int val)
{
if(temp == NULL)
{
temp = new tnode;
temp -> data = val;
}
else
{
if(val < temp -> data)
{
temp -> L = insert(temp -> L, val);
if( ( height(temp -> L) - height(temp -> R) == 2 ) )
{
if(val < temp -> L -> data)
temp = LL(temp);
else
temp = LR(temp);
}
}
else
{
temp -> R = insert(temp -> R, val);
if( ( height(temp -> L) - height(temp -> R)== -2 ) )
{
if(val > temp -> R -> data)
temp = RR(temp);
else
temp = RL(temp);
}
}
}
return temp;
}

void AVL :: inorder(tnode * temp)
{
if(temp != NULL)
{
inorder(temp -> L);
cout << "\n" << temp -> data;
inorder(temp -> R);
}
}

void AVL :: preorder(tnode * temp)
{
if(temp != NULL)
{
cout << "\n"<<temp -> data;
preorder(temp -> L);
preorder(temp -> R);
}
}

void AVL :: display()
{
cout << "\n Data in Sorted way : ";
inorder(root);
cout << "\n Preorder : ";
preorder(root);
}

int main()
{
AVL t;
t.create();
t.display();
cout << endl;
return 0;
}

/*
Initially putting data in increasing order to form right skewed tree

Enter Number : 5
Continue : y
Enter Number : 6
Continue : y
Enter Number : 7
Continue : y
Enter Number : 8
Continue : y
Enter Number : 9
Continue : y
Enter Number : 10
Continue : n

Data in Sorted way :
5
6
7
8
9
10
Preorder :
8
6
5
7
9
10
*/
Loading