Social Media Day Restaurant Post Ideas

Can I Help Post Cards

printed paper mailing post cards at 2 piece in bengaluru id mailing post cards customboxline printed paper mailing post cards at rs 2 piece in bengaluru id first cards ready to post it only takes a stamp help post card template selection of inspiring postcards simplycards selection of inspiring postcards simplycards selection of inspiring postcards simplycards selection of inspiring postcards simplycards limited edition post cards set in support of charity jonathan banks can someone help me interpret this post card r handwriting magic post cards collaborative summer library program store prepaid postage postcards from canada post rite while u can cute animal videos support card greeting cards hallmark cute animal videos support card greeting cards hallmark australia post connecting through postcards keep left how we can help postcard pancreatic cancer uk what to do how we can help the elderly right now do say give caring cards a heartwarming program by the vancouver public library 4x6 postcard of can i help from the wonders of mo from the imagined postcards for post its for patrick meek manor how to make a postcard step by step how to make and send your own artistic postcards the postman s knock give and help donation postcard design com help needed postcard template design id 0000004000 smiletemplates com canada post is sending every canadian household a postcard to send to a got a wrong or missing postcard id stilllovesnailmail 25 reasons to send a card by post make a post card how to make your own postcard using altenew s happy canada post sends every household a free prepaid postcard let s make a post card plus everything you need to know to mail them 10 ways postcards can save your business here s how direct mail mail me some art 10 things you can use to make a postcard please don t hesitate you can create a postcard ihannas blog boom cards community helpers post office read along youtube

:
Watercolor Designs Template Welcome To The Team
Add iterative version of Euclidean algorithm.
1 parent Product Of The Week Flyer commit 2451db9

Printed paper mailing post cards at 2 piece in bengaluru id 4 files changed Instagram Post Template With Likes

Lines changed: 51 additions & 15 deletions

Pharmaceutical Product Launch Dashboard Template Can I Help Post Cards

src/algorithms/math/euclidean-algorithm/__test__/euclieanAlgorithm.test.js renamed to src/algorithms/math/euclidean-algorithm/__test__/euclideanAlgorithm.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import euclideanAlgorithm from '../euclideanAlgorithm';
22

33
describe('euclideanAlgorithm', () => {
4-
it('should calculate GCD', () => {
4+
it('should calculate GCD recursively', () => {
55
expect(euclideanAlgorithm(0, 0)).toBe(0);
66
expect(euclideanAlgorithm(2, 0)).toBe(2);
77
expect(euclideanAlgorithm(0, 2)).toBe(2);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import euclideanAlgorithmIterative from '../euclideanAlgorithmIterative';
2+
3+
describe('euclideanAlgorithmIterative', () => {
4+
it('should calculate GCD iteratively', () => {
5+
expect(euclideanAlgorithmIterative(0, 0)).toBe(0);
6+
expect(euclideanAlgorithmIterative(2, 0)).toBe(2);
7+
expect(euclideanAlgorithmIterative(0, 2)).toBe(2);
8+
expect(euclideanAlgorithmIterative(1, 2)).toBe(1);
9+
expect(euclideanAlgorithmIterative(2, 1)).toBe(1);
10+
expect(euclideanAlgorithmIterative(6, 6)).toBe(6);
11+
expect(euclideanAlgorithmIterative(2, 4)).toBe(2);
12+
expect(euclideanAlgorithmIterative(4, 2)).toBe(2);
13+
expect(euclideanAlgorithmIterative(12, 4)).toBe(4);
14+
expect(euclideanAlgorithmIterative(4, 12)).toBe(4);
15+
expect(euclideanAlgorithmIterative(5, 13)).toBe(1);
16+
expect(euclideanAlgorithmIterative(27, 13)).toBe(1);
17+
expect(euclideanAlgorithmIterative(24, 60)).toBe(12);
18+
expect(euclideanAlgorithmIterative(60, 24)).toBe(12);
19+
expect(euclideanAlgorithmIterative(252, 105)).toBe(21);
20+
expect(euclideanAlgorithmIterative(105, 252)).toBe(21);
21+
expect(euclideanAlgorithmIterative(1071, 462)).toBe(21);
22+
expect(euclideanAlgorithmIterative(462, 1071)).toBe(21);
23+
expect(euclideanAlgorithmIterative(462, -1071)).toBe(21);
24+
expect(euclideanAlgorithmIterative(-462, -1071)).toBe(21);
25+
});
26+
});
Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
/**
2+
* Recursive version of Euclidean Algorithm of finding greatest common divisor (GCD).
23
* @param {number} originalA
34
* @param {number} originalB
45
* @return {number}
56
*/
6-
7-
/*Method 1: A bit Complex to understand*/
87
export default function euclideanAlgorithm(originalA, originalB) {
8+
// Make input numbers positive.
99
const a = Math.abs(originalA);
1010
const b = Math.abs(originalB);
1111

12+
// To make algorithm work faster instead of subtracting one number from the other
13+
// we may use modulo operation.
1214
return (b === 0) ? a : euclideanAlgorithm(b, a % b);
1315
}
14-
15-
/*Method 2: Easy to evaluate*/
16-
export default function euclideanAlgorithm2(originalA, originalB) {
17-
const a = Math.abs(originalA);
18-
const b = Math.abs(originalB);
19-
20-
while(a != b){
21-
[a,b] = a>b : [a-b, b] : [a, b-a]
22-
}
23-
24-
return a || b;
25-
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Iterative version of Euclidean Algorithm of finding greatest common divisor (GCD).
3+
* @param {number} originalA
4+
* @param {number} originalB
5+
* @return {number}
6+
*/
7+
export default function euclideanAlgorithmIterative(originalA, originalB) {
8+
// Make input numbers positive.
9+
let a = Math.abs(originalA);
10+
let b = Math.abs(originalB);
11+
12+
// Subtract one number from another until both numbers would become the same.
13+
// This will be out GCD. Also quit the loop if one of the numbers is zero.
14+
while (a && b && a !== b) {
15+
[a, b] = a > b ? [a - b, b] : [a, b - a];
16+
}
17+
18+
// Return the number that is not equal to zero since the last subtraction (it will be a GCD).
19+
return a || b;
20+
}

As Per My Last Email Can I Help Post Cards

Comments
 (0)