StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Analyze code 3 - Assignment Example

Cite this document
Summary
Choose one algorithm that was created and posted by another student to solve the same problem, and analyze the differences between the effectiveness of the two algorithms. Post the result of the analysis, and improvements.
1)      To verify if a number is divisible by…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER97.3% of users find it useful
Analyze code 3
Read Text Preview

Extract of sample "Analyze code 3"

Choose one algorithm that was created and posted by another to solve the same problem, and analyze the differences between the effectiveness of the two algorithms. Post the result of the analysis, and improvements.DQ1:CK,ML,JL,AL,KSem  Code 1The following optimizations have been used:1)      To verify if a number is divisible by three it is enough to make sure the sum of the numbers digits is divisible by three. A counter ModSoFar is kept to see what the mod of the sum of the digits is in the currently tested string.

This optimization helps contain the very large division that occurs on all of the tests to a mod of a number that is 11 at most. This might be optimized even further by changing the mod to an if and specifying if the ModSoFar is equal to 0,3,6 or 9 then.but that depends on the efficiency of the CPU and whether four comparisons is faster than one mod. Similar shortcuts are available for all of the numbers under 10 (Magness, Sinnot & Ward, 2004)2)      In order to save going over the Digits to find the sub string that is needed for printing, the program keeps the growing string in a variable adding and additional characters as needed.

As a side note, according to Brookshear (2007) the indentation rules require an else to be directly under the indented “then” of an “if” which is confusing when there is an “if” with no “else” inside an “if” with one (see lines 16 and 19 where the “else” actually belongs to the “if” on line 13).Procedure SubStrMod3(Digits)                StartChar

Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Analyze code 3 Assignment Example | Topics and Well Written Essays - 500 words”, n.d.)
Retrieved de https://studentshare.org/information-technology/1579492-analyze-code-3
(Analyze Code 3 Assignment Example | Topics and Well Written Essays - 500 Words)
https://studentshare.org/information-technology/1579492-analyze-code-3.
“Analyze Code 3 Assignment Example | Topics and Well Written Essays - 500 Words”, n.d. https://studentshare.org/information-technology/1579492-analyze-code-3.
  • Cited: 0 times

CHECK THESE SAMPLES OF Analyze code 3

Mass Spectrometry: How Is It Works

This paper "Mass Spectrometry: How Is It Works " presents mass spectrometry which involves measuring the mass of a compound, this with very high sensitivity.... Adequate monitoring of the levels of galanin in the digestive tract can help in predicting one's risk for developing metabolic disorders....
8 Pages (2000 words) Research Paper

Dynamic Analysis of Malware

A function comprises of a code that executes a certain task like creating a file or calculating factorial value of a number.... In the use of functions easy code re-usability, and easier maintenance can result.... When it comes to analyzing code, such abstractions help in gaining an overview of the behavior of the program when analyzing a code.... The only code that is executed in kernel-mode has direct entry to the system state....
4 Pages (1000 words) Research Paper

Terrorist Activities & Community Members

Terrorist Activities & Community Members Name School Abstract This paper provides a brief overview of how information gathering can assist law enforcement in obtaining information on potential terrorist activities that could occur in the near future.... Gathering information from the community is a very valuable component of any law enforcement's information tools which can then be incorporated into any of its database systems for further analyses....
5 Pages (1250 words) Assignment

Advantages of Multitouch Technology

analyze a Case Study INTRODUCTION Multitouch technologies are steadily gaining popularity across the world.... THESIS STATEMENT This paper intends to prudently analyze the case study related with mulitouch interfaces.... It has facilitated certain category of users to overcome the limitations imposed by the use of mouse and keyboards....
3 Pages (750 words) Case Study

Blood Gas Analysis and Osmometry

The sensor molecule is selective for the specific analyte is the pH sensor molecule will only react with the H+ molecules, the O2 molecules etc.... the… ty of the emitted fluorescence light varies with the concentration of the ions (H+, Na +, K +) or the partial pressure of the gas molecules (O2 and CO2 ) in the sample in a predictable fashion....
6 Pages (1500 words) Lab Report

Children Support Agency System

The emerging need for the better organizational management and overall processes handling makes its vital to implement an organizational information management system.... The implementation of the efficient information management system makes it possible to handle the overall… Children Support Agency is a national charity based in the UK that cares for young people who require additional support to help them live their lives successfully....
11 Pages (2750 words) Essay

How to Use Wireshark to Capture a Packet Trace

In this report “How to use Wireshark to Capture a Packet Trace” the author will assess Wireshark technology-based application with respect to its overall technological working, operations, history and mainly for the Linux based services administration.... hellip; The author states that Wireshark technology is a network protocol analyzer system....
12 Pages (3000 words) Assignment

Practical Data Mining Using C Language

The code used to do the data mining in this assignment has been written in c language and output from the console following the ID3 algorithm.... This spans from lines 17 to 39 of the code as commented appropriately.... They include: Classification Clustering Regression Anomaly detection Association rules Reinforcement learning Structured prediction Feature engineering Summarization Any of the above techniques can be used individually or in combination with another or a number of them thereof to analyze a dataset....
7 Pages (1750 words) Lab Report
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us