Seriously Good Software: Code that works, survives, and wins by Marco Faella
Author:Marco Faella
Language: eng
Format: mobi, epub, pdf
Publisher: Manning Publications
Published: 2020-03-16T10:06:57.356000+00:00
1 The original procedure goes here (modifies u and v).
int gcd = -u * ( 1 <{}< k);
assert isGcd(gcd, originalU, originalV) : "Wrong GCD!";
return gcd;
}
For the auxiliary isGcd method, I said the simplest solution is preferable. In this case, you may simply apply the definition of “greatest common divisor,” and check that
gcd is indeed a common divisor of originalU and originalV
every larger number is not a common divisor
private static boolean isGcd(int gcd, int u, int v) {
if (u \% gcd != 0 || v \% gcd != 0) 1 Checks that gcd is a common divisor
return false;
for (int i=gcd+1; i<=u && i<=v; i++) 2 Checks any larger number,
if (u \% i == 0 && v \% i == 0) up to the minimum of u and v
return false;
return true;
}
This implementation of isGcd is very inefficient, being linear in the size of the smallest number between u and v. A more reasonable course of action would be to use Euclid’s classic algorithm (https://en.wikipedia.org/wiki/Euclidean_algorithm) or invoke an already implemented GCD procedure, such as the BigInteger.gcd() method from the JDK.
Download
Seriously Good Software: Code that works, survives, and wins by Marco Faella.epub
Seriously Good Software: Code that works, survives, and wins by Marco Faella.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Coding Theory | Localization |
Logic | Object-Oriented Design |
Performance Optimization | Quality Control |
Reengineering | Robohelp |
Software Development | Software Reuse |
Structured Design | Testing |
Tools | UML |
Deep Learning with Python by François Chollet(12590)
Hello! Python by Anthony Briggs(9926)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9802)
The Mikado Method by Ola Ellnestam Daniel Brolund(9787)
Dependency Injection in .NET by Mark Seemann(9348)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8309)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7772)
Grails in Action by Glen Smith Peter Ledbrook(7705)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7566)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7164)
Microservices with Go by Alexander Shuiskov(6933)
Practical Design Patterns for Java Developers by Miroslav Wengner(6850)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6793)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6424)
Angular Projects - Third Edition by Aristeidis Bampakos(6209)
The Art of Crafting User Stories by The Art of Crafting User Stories(5723)
NetSuite for Consultants - Second Edition by Peter Ries(5656)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5467)
Kotlin in Action by Dmitry Jemerov(5074)
