In: Computer Science
What are the data structures and algorithms? Why are they
important to software developers?
Give an example of using a data structure.
Give an example of using algorithm.
Use Google to search for your answers. Minimum 400 words and a
maximum of 1000 words.
To be precise, Data Structures are the ones that can be used to store and organize data. Whereas Algorithms are used to access (Search, sort, insert, update and Delete) data to solve a particular problem.
Data Structures:
Any computer program is a set of instructions to perform a task OR solve a problem. Data Structures is a concept that can used to storing the data and organizing the data efficiently. Data Structures is about storing data with some relationship within data for better organization, storage and retrieval. In another words, Data Structures are the way to store data programmatically and use it efficiently.
Basic examples of Data Structures:
· Stack – To store and retrieve data using LIFO (Last in First Out) principles. Example: Stack of plates in buffet table. Here which ever plate is last in to the stack it will be taken out first.
· Queue – To store and retrieve data using FIFO (First in First Out) principles. Example: Movie ticket booking queue. Whoever first in to the queue will get the tickets first.
· Linked List – To store data in terms of nodes and maintain links between nodes. One node will be linked to other nodes. Example: Single Linked List and Double linked list.
· Tree – To store data in tree structure. Example: Binary Tree and Red Black Tree
· Graph – To store data in graph structure.
Algorithms:
Algorithm is a series of steps OR instructions OR logic to solve or accomplish a certain problem. Algorithm is not the program. It is just logical steps to accomplish given problem. Algorithm can be represented by high level description i.e. pseudocode or flowchart. Algorithm is not depends on programming language. Developers should implement code based on the algorithm.
Basic examples of Algorithms:
· Sort – Algorithm to sort items in given input data structure. Example: Bubble Sort, Merge Sort, Quick Sort, Heap Sort and Insertion Sort etc.
· Search – To search an item in given input data structure. Example: Linear Search and Binary Search.
· Insert – To insert a new item in data structure.
· Update – To update existing item in data structure.
· Delete – To delete an item from the data structure.
Why Data Structures and Algorithms are important to software developers?
Companies invests in software development to solve the business problems. Software developers may involve during analysis, design and coding life cycle of a software development process. Developers should have strong knowledge about Data Structures and Algorithms to choose right data structure to store and organize data. And to choose right algorism to access or update data underlying in data structure. For example certain problem can be accomplished by using multiple data structures and algorithms. But developer’s responsibility to choose right data structure and algorithm based on below factors
· Time Complexity – How much time a program will take to complete execute for any set of input whether it may be small input or input volume is high.
· Space Complexity – How much space required to execute a specific program.
These Time and Space complexities are denoted by using Big O notation. Every data structure and algorithm has different time and space complexities. Based on the requirement specification, programmer has to choose right data structure. In order to understand Time and Space complexities, Developer should have deeper knowledge in Data Structures and Algorithms.