Techniques to Develop Structured Programs
- In order for written computer programs to perform tasks, there must be a suitably constructed algorithm. Furthermore, the common tasks can be divided into sorting and searching, sorting is the ordering of listed values whilst searching is described as finding the position of a value in a list.
An algorithm in its essence is a limited sequence of particular directions for computational performance in order to solve a problem. Sorting, in particular, is efficient for its use in programming - being able to find and locate items in a sorted list rather than having to go through a tedious search process.
- One algorithm is selection sort where the smallest element is found and moved to the front, swapping with the front element.
- Another sorting algorithm is bubble sort, where it starts at the beginning of the list and swaps the first two elements if the first is bigger than the second and continues this pattern for the next pair and so on until the list is sorted.
- The best one of all however is quicksort for it being the fastest by selecting a pivot number to separate the data with larger numbers on the right and the smaller numbers on the left.
"Searching algorithms is a basic, fundamental step in computing done via step-by-step method to locate a specific data among a collection of data." (Casey, 2020)
In a program it is incumbent to be able to retrieve specific data in a collection of a large amount of data; therefore marking the importance of search algorithms, especially ones like binary -
- Binary is considered the best of the searching algorithms because it is a fast and proficient manner of finding a target in a list by cutting the search in half by starting from the middle choosing whether to ascend or descend the list.
Data structure techniques are also very important to structured programming development.
- Stacks are used for evaluating mathematical expressions and enforcing function calls in recursion programming. Defined as LIFO ( Last in last out) structures, making it possible for elements placed lastly to be accessed first through push and pop procedures.
- Arrays are a standard structure described as a collection of items that are sequentially stored - usually containing elements of similar data type and set size indexed at zero. Arrays are typically used for building other complex data structures and arrays harken back to sorting algorithms since they are commonly used for those kinds of algorithms
- Queues function like stacks but are FIFO (first in first out) instead and act as a line or list of values where the first value will be stated first and the last will be stated last. You can insert an element in the queue in a different position or delete an element from the queue completely known as dequeing.
- Trees are structured in hierarchical formation with each item linked like in linked list. A binary tree like the one we worked on, stores data in a sorted order with each node in the binary composed of four features :
- Key (the value saved in the node)
- Left (pointer to the left child node)
- Right (pointer to the right child node)
- P (pointer to the parent node)
Discuss in the post how you would apply algorithmic design and data structure techniques in developing structured programs.
I would utilize binary search and quick sort for a divide and conquer approach. The divide and conquer method breaks the problem down into sub-problems which are then unraveled recursively and put together to get the solution to the original problem. As far as the techniques I've utilized in the class go, I would definitely feel confident in using pop, peek, and push functions in the stack class along with queues to set up a list to add elements that could be altered using stack commands.
Casey, K. (2021, April 26). Let us understand searching algorithms. Hire from top 1% remote developer and teams on codersera. Retrieved January 18, 2022, from https://codersera.com/blog/let-us-understand-searching-algorithms/
Goel, H. (2021, September 13). 7 steps to improve your data structure and algorithm skills. HackerEarth Blog. Retrieved February 8, 2022, from https://www.hackerearth.com/blog/developers/7-steps-to-improve-your-data-structure-and-algorithm-skills
Eight data structures every programmer has to know. EmergingEd. (2021, April 14). Retrieved February 8, 2022, from https://emerginged.com/blogs/emerginged-blog/eight-data-structures-every-programmer-has-to-know?ga_client_id=GA1.2.1711159892.1644288838&viewId=emergingedkzdj4bzbas4jgi
Comments
Post a Comment