You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-16Lines changed: 20 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,8 +91,8 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
91
91
92
92
1.[`Abs`](./math/binary/abs.go#L10): Abs returns absolute value using binary operation Principle of operation: 1) Get the mask by right shift by the base 2) Base is the size of an integer variable in bits, for example, for int32 it will be 32, for int64 it will be 64 3) For negative numbers, above step sets mask as 1 1 1 1 1 1 1 1 and 0 0 0 0 0 0 0 0 for positive numbers. 4) Add the mask to the given number. 5) XOR of mask + n and mask gives the absolute value.
93
93
2.[`BitCounter`](./math/binary/bitcounter.go#L11): BitCounter - The function returns the number of set bits for an unsigned integer number
94
-
3.[`IsPowerOfTwo`](./math/binary/checkisnumberpoweroftwo.go#L19): IsPowerOfTwo This function uses the fact that powers of 2 are represented like 10...0 in binary, and numbers one less than the power of 2 are represented like 11...1. Therefore, using the and function:10...0& 01...1 00...0 -> 0 This is also true for 0, which is not a power of 2, for which we have to add and extra condition.
95
-
4.[`IsPowerOfTwoLeftShift`](./math/binary/checkisnumberpoweroftwo.go#L26): IsPowerOfTwoLeftShift This function takes advantage of the fact that left shifting a number by 1 is equivalent to multiplying by 2. For example, binary 00000001 when shifted by 3 becomes 00001000, which in decimal system is 8 or = 2 * 2 * 2
94
+
3.[`IsPowerOfTwo`](./math/binary/checkisnumberpoweroftwo.go#L21): IsPowerOfTwo This function uses the fact that powers of 2 are represented like 10...0 in binary, and numbers one less than the power of 2 are represented like 11...1. Therefore, using the and function:10...0& 01...1 00...0 -> 0 This is also true for 0, which is not a power of 2, for which we have to add and extra condition.
95
+
4.[`IsPowerOfTwoLeftShift`](./math/binary/checkisnumberpoweroftwo.go#L28): IsPowerOfTwoLeftShift This function takes advantage of the fact that left shifting a number by 1 is equivalent to multiplying by 2. For example, binary 00000001 when shifted by 3 becomes 00001000, which in decimal system is 8 or = 2 * 2 * 2
96
96
5.[`LogBase2`](./math/binary/logarithm.go#L7): LogBase2 Finding the exponent of n = 2**x using bitwise operations (logarithm in base 2 of n) [See more](https://en.wikipedia.org/wiki/Logarithm)
97
97
6.[`MeanUsingAndXor`](./math/binary/arithmeticmean.go#L12): MeanUsingAndXor This function finds arithmetic mean using "AND" and "XOR" operations
98
98
7.[`MeanUsingRightShift`](./math/binary/arithmeticmean.go#L17): MeanUsingRightShift This function finds arithmetic mean using right shift
@@ -238,7 +238,7 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
238
238
239
239
---
240
240
241
-
##### Package diffiehellman implements Deffie Hellman Key Exchange Algorithm for more information watch : https://www.youtube.com/watch?v=NmM9HA2MQGI
241
+
##### Package diffiehellman implements Diffie-Hellman Key Exchange Algorithm for more information watch : https://www.youtube.com/watch?v=NmM9HA2MQGI
242
242
243
243
---
244
244
##### Functions:
@@ -501,7 +501,7 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
501
501
502
502
---
503
503
504
-
##### Package linkedlist demonstates different implementations on linkedlists.
504
+
##### Package linkedlist demonstrates different implementations on linkedlists.
505
505
506
506
---
507
507
##### Functions:
@@ -552,8 +552,11 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
552
552
3.[`FindKthMax`](./math/kthnumber.go#L11): FindKthMax returns the kth large element given an integer slice with nil `error` if found and returns -1 with `error``search.ErrNotFound` if not found. NOTE: The `nums` slice gets mutated in the process.
553
553
4.[`FindKthMin`](./math/kthnumber.go#L19): FindKthMin returns kth small element given an integer slice with nil `error` if found and returns -1 with `error``search.ErrNotFound` if not found. NOTE: The `nums` slice gets mutated in the process.
554
554
5.[`IsPowOfTwoUseLog`](./math/checkisnumberpoweroftwo.go#L10): IsPowOfTwoUseLog This function checks if a number is a power of two using the logarithm. The limiting degree can be from 0 to 63. See alternatives in the binary package.
555
-
6.[`Phi`](./math/eulertotient.go#L5): Phi is the Euler totient function. This function computes the number of numbers less then n that are coprime with n.
556
-
7.[`Sin`](./math/sin.go#L9): Sin returns the sine of the radian argument x. [See more](https://en.wikipedia.org/wiki/Sine_and_cosine)
555
+
6.[`Mean`](./math/mean.go#L7): No description provided.
556
+
7.[`Median`](./math/median.go#L12): No description provided.
557
+
8.[`Mode`](./math/mode.go#L19): No description provided.
558
+
9.[`Phi`](./math/eulertotient.go#L5): Phi is the Euler totient function. This function computes the number of numbers less then n that are coprime with n.
559
+
10.[`Sin`](./math/sin.go#L9): Sin returns the sine of the radian argument x. [See more](https://en.wikipedia.org/wiki/Sine_and_cosine)
557
560
558
561
---
559
562
</details><details>
@@ -623,7 +626,7 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
623
626
---
624
627
##### Functions:
625
628
626
-
1.[`IsBalanced`](./other/nested/nestedbrackets.go#L20): IsBalanced returns true if provided input string is properly nested. Input is a sequence of brackets: '(', ')', '[', ']', '{', '}'. A sequence of brackets `s` is considered properly nested if any of the following conditions are true: - `s` is empty; - `s` has the form (U) or [U] or {U} where U is a properly nested string; - `s` has the form VW where V and W are properly nested strings. For example, the string "()()[()]" is properly nested but "[(()]" is not. **Note** Providing characters other then brackets would return false, despite brackets sequence in the string. Make sure to filter input before usage.
629
+
1.[`IsBalanced`](./other/nested/nestedbrackets.go#L20): IsBalanced returns true if provided input string is properly nested. Input is a sequence of brackets: '(', ')', '[', ']', '{', '}'. A sequence of brackets `s` is considered properly nested if any of the following conditions are true: - `s` is empty; - `s` has the form (U) or [U] or {U} where U is a properly nested string; - `s` has the form VW where V and W are properly nested strings. For example, the string "()()[()]" is properly nested but "[(()]" is not. **Note** Providing characters other then brackets would return false, despite brackets sequence in the string. Make sure to filter input before usage.
627
630
628
631
---
629
632
</details><details>
@@ -765,7 +768,7 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
765
768
766
769
##### Functions:
767
770
768
-
1.[`Distance`](./math/pythagoras/pythagoras.go#L15): Distance calculates the distance between to vectors with the Pythagoras theorem
771
+
1.[`Distance`](./math/pythagoras/pythagoras.go#L15): Distance calculates the distance between to vectors with the Pythagoras theorem
769
772
770
773
---
771
774
##### Types
@@ -868,7 +871,7 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
868
871
869
872
---
870
873
871
-
##### Package sort a package for demonstrating sorting algorithms in Go
874
+
##### Package sort a package for demonstrating sorting algorithms in Go Package sort Patience sorting is a sorting algorithm inspired by the card game patience. For more details check out those links below here: GeeksForGeeks article : https://www.geeksforgeeks.org/patience-sorting/ Wikipedia article: https://en.wikipedia.org/wiki/Patience_sorting authors [guuzaa](https://github.com/guuzaa) see patiencesort.go
872
875
873
876
---
874
877
##### Functions:
@@ -883,13 +886,14 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
883
886
8.[`Merge`](./sort/mergesort.go#L40): Merge Perform merge sort on a slice
884
887
9.[`MergeIter`](./sort/mergesort.go#L54): No description provided.
885
888
10.[`Partition`](./sort/quicksort.go#L12): No description provided.
886
-
11.[`Pigeonhole`](./sort/pigeonholesort.go#L12): Pigeonhole sorts a slice using pigeonhole sorting algorithm.
887
-
12.[`Quicksort`](./sort/quicksort.go#L39): Quicksort Sorts the entire array
888
-
13.[`QuicksortRange`](./sort/quicksort.go#L26): QuicksortRange Sorts the specified range within the array
889
-
14.[`RadixSort`](./sort/radixsort.go#L35): No description provided.
890
-
15.[`Selection`](./sort/selectionsort.go#L5): No description provided.
891
-
16.[`Shell`](./sort/shellsort.go#L5): No description provided.
892
-
17.[`Simple`](./sort/simplesort.go#L13): No description provided.
889
+
11.[`Patience`](./sort/patiencesort.go#L13): No description provided.
890
+
12.[`Pigeonhole`](./sort/pigeonholesort.go#L12): Pigeonhole sorts a slice using pigeonhole sorting algorithm.
891
+
13.[`Quicksort`](./sort/quicksort.go#L39): Quicksort Sorts the entire array
892
+
14.[`QuicksortRange`](./sort/quicksort.go#L26): QuicksortRange Sorts the specified range within the array
893
+
15.[`RadixSort`](./sort/radixsort.go#L35): No description provided.
894
+
16.[`Selection`](./sort/selectionsort.go#L5): No description provided.
895
+
17.[`Shell`](./sort/shellsort.go#L5): No description provided.
896
+
18.[`Simple`](./sort/simplesort.go#L13): No description provided.
0 commit comments