Skip to main content

Algorithm and Data Structure

 “Every program depends on algorithms and data structures, but few programs depend on the invention of brand-new ones.” — Kernighan & Pike.

Also, think about this, whichever device you are reading this Blog on, Algorithms helped create it.

Whether it be your Smart Phone, iPad, Laptop, desktop, or whatever device you prefer, the data structure on that device was created with an Algorithm.

First, let us ask, what is an algorithm? An algorithm is a sequence of steps for accomplishing a task.

Algorithms perform the calculation, data processing, and automated reasoning tasks. (Williams, 2020)

The critical thing to remember is that IT has all been done before and follow the steps below. And we write algorithms in a step-by-step manner, but it is not always the case. Algorithm writing is a process and is executed after the problem domain is well-defined. That is, we should know the problem domain for which we are designing a solution.


Data structure and categories of Algorithm are:


Search − Algorithm to search an item in a data structure.

Sort − Algorithm to sort items in a particular order.

Insert − Algorithm to insert an item in a data structure.

Update − Algorithm to update an existing item in a data structure.

Delete − Algorithm to delete an existing item from a data structure.


Not all procedures can be called an algorithm. An algorithm should have the following characteristics −

Unambiguous − The Algorithm should be clear and unequivocal. Each of its steps (or phases) and their inputs/outputs should be precise and lead to only one meaning.

Input − An algorithm should have 0 or more well-defined inputs.

Output − An algorithm should have one or more well-defined outcomes and should match the desired result.

Finiteness − Algorithms must terminate after a finite number of steps.

Feasibility − Should be feasible with the available resources.

Independent − An algorithm should have step-by-step directions, which should be independent of any programming code.

.Tutorials,2021)

Data structures are a defined and orderly set of data arranged to make a process easier to follow. They store objects and allow their manipulation based on two different types: Linear, Arrays, Stacks, Linked, Lists, Queues, Non-Linear, Trees, Graphs, Tables, and Sets. (Zybooks, 2015)


References;

Tutorials point. (2021). Data Structures - Algorithms Basics, https://www.tutorialspoint.com/data_structures_algorithms/algorithms_basics.htm


Lysecky, R., Vahid, F., Lysecky, S., & Givargis, T. (2015). Data structures essentials. Retrieved from https://zybooks.zyante.com/#/zybook/DataStructuresEssentialsR25/chapter/1/section/3


Williams, J. (2020, January 18). Why Do Programmers Need To Focus On Data Structure & Algorithms? https://www.uniwebb.com/blog/post/why-do-programmers-need-to-focus-on-data-structure--algorithms/1780/

Comments

Popular posts from this blog

OS Theory Concept Map/ Final Project Week 5

  Categorize, describe, and give examples of the major functions of operating systems. According to Operating System Concepts Essentials (2014), operating systems' primary functions include CPU scheduling, memory management, communication management, synchronization, error detection, resource allocation, accounting, and protection and security. Also, the explanation of algorithms, structures, and threads. The functionalities are interface (UI) is what the user sees and interacts with to natural processes on the computer. The UI can be a command line, batch interface, or a graphical user interface (GUI) (Silberschatz, Galvin, Gagne, 2014). Program execution refers to the ability to start and stop a program. A program first needs to be loaded to the main memory to execute and can then be terminated normally or through an error. I/O operations are managed through the operating system so as not to introduce user error when a program calls for input or output from/to