Skip to main content

Applying Algorithmic Design & Data Structure Techniques

   This week's resource article describes an algorithm as, "a procedure that you can write as a C function or program, or any other language. An algorithm states explicitly how the data will be manipulated." (Complexity Analysis, n.d.). 

  The length of time a program takes to complete a given task depends on its algorithm. The algorithm deals with how data is organized and how it is accessed. The biggest considerations for creating applications are time complexity and space complexity. 

   With time complexity, this refers to the number of operations needed and the time it takes it takes for them to run. This is typically measured in milliseconds. Operations are typically: 'compare', 'swap', 'fetch from memory' and 'send to memory'. While each operation takes only a small amount of time; the number of operations that are necessary grow exponentially. As the list of operations grows, so too does the time it takes for them to be enacted. 

   Space complexity refers to the space or memory an algorithm uses to solve a problem. Exponential growth doesn't occur with space complexity, as it does with time complexity.  As an algorithm uses more data, space may be freed up with each computer cycle or keep growing. Running out of memory is something that may occur and must be accounted for. 

   "Big O notations" or algebraic calculations ultimately determine if time grows by a number equal to the input or if there is an exponential growth in time as input increases. This can also be used to determine if memory usage remains constant or continues to grow with data input.

Are some algorithms and data structure designs better than others? 

   Algorithms should be selected based on the type of input that is being received. Selecting the appropriate algorithm will have varying effects on performance. With the example of a binary search algorithm, this is an algorithm that should only be used on data that is, or can be, sorted. This refers to when we have a list of sorted numbers and are looking for a specific number. In this scenario, a binary search is more beneficial and faster than a linear search or sequential search. 

Developing The Application

   When software developers are building a structured program, it is important to scope the project. To know exactly what the purpose will be. Once we clearly define the problem, we can then measure the constraints such as input size, output format and whether or not there are limitations. When that is known, we can then choose an algorithm that best suits this need. Trail and error is the next phase of the process. Testing the algorithm with different inputs will ensure that it works as predicted.  


Michael Streat 

Works Cited:

Complexity analysisLinks to an external site.. (n.d.). Retrieved from http://www.cs.utexas.edu/users/djimenez/utsa/cs1723/lecture2.html


Comments

Popular posts from this blog

Network Security

    With the advent of computers and the internet, so too came the invention of harmful scams. These malicious entities have become more and more prevalent since the turn of the century and exist in various forms. From existing in different types of computer viruses, spam emails, phishing, and Denial of Service (DoS) attacks there are a multitude of ways for user’s personal information to be accessed and disseminated without knowledge or consent.               During week 3 of our course we learned about ping commands and even practiced using these to access different websites. This week’s venture into security took the concept even further by revealing how one can use ping commands in a negative and harmful way in the form of Denial of Service (DoS) attacks. These types of security breaches require no hacking of any kind, nor does it involve the installation of any type of malicious software which is also known ...

CPT 307: Data Structures & Algorithms - Week 1!

 Hello World! I am back in the blogosphere after several months. The present course is called "Data Structures & Algorithms" and this week's focus is centered around installing Java and reviewing object-oriented design principles.  Thankfully the instructions embedded within the course made the installation of Java and IDE (integrated development environment) NetBeans seamless. The links provided to each website were straightforward (for the most part):  NetBeans (version 16):  https://netbeans.apache.org/download/index.html Java (version 19):  https://www.oracle.com/java/technologies/downloads/ The 4 major principles of Object-Oriented Programming:  1) Encapsulation - The hiding of data implementation by restricting access to accessors and mutators. The pieces that surround the data that forms the class. An Accessor is a method that is used to ask an object about itself (Lewallen, 2005). This is typically in the form of properties. Mutators are public...