The study of data structure helps to analyze the algorithm. The study of data structure involves identification and creation of useful mathematical entities and operations, which solve the number of real world problems.
Data structure is a way to store and organize data .a data structure is a particular way of organizing data in a computer so that it can be used effectively.
In computer programming a data structure may be selected or designed to store data for the purpose of working on it with various algorithms .each data structure contains information about the data values relationships between the data and functions that can be applied to the data. A few factors to consider when picking a data structure include what kind of information will be stored, where should data be sorted and how much memory should be reserved for data.
Data structure are the main part of many computer science algorithms as they enable the programmers to handle the data in an efficient way .it plays a vital role in enhancing the performance of a software or a program as the main function of the software is to store and retrieve the user`s data as fast as possible. Data structures are being used in almost every program or software system that has been developed .moreover, data structure comes under the fundamentals of computer science and software engineering .it is a key topic when it comes to software engineering interview questions.
Data structures are the foundation of any solid computer. Program without the right data structure in place it’s very difficult to value an efficient program computer programs, Rely on data and lots of it. The right data structure organize many data can easily be accessed, modified and configured.
some example of data structures are array ,linked list ,stack,queue,etc.
For example
Now take the example of a library if you need to find a book on electronics from a library, you will go to the section first, the electronics sections .if those books are not organized in this manner and just distributed randomly then it will be frustrating to find a specific books so data structures refer to the way we organized information on our computer.
Another example, have you ever scolded by your parents when you were unable to find your books, clothes, notebook or other important things in your messed up room? Definitely yes… your parents are right when they give the advice to keep everything in the right place so the next time you can get your stuff easily .hare you need to arrange and keep everything (data) in such a structure that whenever you need to search something you get that easily and as soon as possible.
Above example give you a clear understanding that how the organization of data is really important in our day to day life .arranging data in specific structure is really helpful. In saving a lot of time and it becomes easier to manipulate or use them.
Types of data structure
PRIMITIVE DATA STRUCTURE
The data structures that are directly operated upon by machine level instructions .primitive data type is predefined by the programming language .the size and type of variable values are specified and it has no additional methods. Data structure are used as a framework for organizing and storing information in virtual memory forms ,in computing such as the cloud or other shared storage system store large quantities of data rapidly and efficiently.
NON-PRIMITIVE DATA STRUCTURE
The data structures, which define the set of derived elements. non primitive data structures are more complicated data structure they emphasize on grouping same or different data items with relationship between each data item .non -primitive data types are not defined by the programming. They are sometimes called “reference variables” or object reference since they reference a memory location which stores the data
Ex. array, structures
there are two types of non primitive data structures.
LINEAR DATA STUCTURE
element of linear data structure are accessed in a sequential manner ,howeverthe element can be stored in these data structure in any order .example linked list ,stack ,queue and array
NON LINEAR DATA STUCTURE
element of non lenear data structure are stores and accessed in non linear order.
example .tree and graph
Operation on data structures
The four major operations Performed on data structure.
Insertion – insertion means adding new detail into the data structure.
Searching – it finds the presence of desired data item in the list of data items it may also find the locations of all elements that satisfy certain conditions.
Deletion – deletion means removing a node from the data structure.
Traversal – traversing means accessing each node exactly once so that the nodes of a data structure can be processed traversing also called as visiting.
Two more operations occasionally performed on data structured.
Sorting – sorting means arranging the data in a particular order.
Merging – it is used to combine the data items of two sorted files into single file in the sorted form.
updation-updating the current value in the data structure with some new value.
NEEDS OF DATA STUCTURE
As Application are getting complex and amount of data is increasing day by day there may arise the following problems.
PROCESSOR SPEED
To handle very large amount of data, high speed processing is required, but as the data is growing day by day to the billions of files per entity, processor may fail to deal with that much amount of data.
DATA SEARCH
Consider an inventory size of 107 items in a store, If our application needs to search for particular item, it needs to traverse 107 items every time, result in slowing down the search process.
MULTIPLE REQUESTS
If thousands of users searching the data simultaneously on a web server then there are the chances that a very large server can be failed during that process.
In order to solve above problems, data structures are used. Data is organized to form a data structure in such a way that all items are not required to be searched and required data can be searched instantly.
APLICATIONS OF DATA STUCTURE
1. Compiler design.
2. Data base management system.
3. Operating system.
4. Statistical analysis package.
5. Numerical analysis.
6. Computer aided graphics.
7. Artificial intelligence.
8. Machine intelligence.
9. Simulations.
ALGORITHM
Algorithm is the set of instructions that defines not just what needs to be done but how to do it. Computer can’t do anything without being told what to do.algorithem allow us to give computers step-by-step instructions in order to solve a problem or perform a task
Properties
OUTPUT /INPUT
SPECIFID
The input is the data to be transformed during the computation to produce the output .the algorithm must accept zero or more input and must produce at least one output ex. Zero is input algorithm print the ASCII code of each of letter in the alphabet of the computer sustem.
EFFECTIVENESS
An algorithm should be effective. Effective means that each step should be referred as principle and should be executing in finite time.
DEFINITENESS
The algorithm must be finite i.e. it should not end up in an infinite loops or similar.
FINENESS
An algorithm should terminate infinite number of steps and each step must finish in infinite amount of time.
BASIC FLOWCHART
SYMBOLS USE IN ALGORITHM
THE OVAL /TERMINATOR
RECTANGLE
Rectangle is your go to symbol once you have start flow chartirng.ir represented any steps in the process you’re drag ramming and is the workhorse of the flow chart diagram. use rectangles to capture process steps like basic
DIAMOND
The diamond symbolizes that a decision
is required to move forward. Stands for decision statements in a program, where
answer is usually yes or no. Decision shape is represented as a diamond this
object is always used in process flow to ask a question and the decision asks a
question the answer to the question determines which arrow you follow out of
the decision shape .for ex. In the shape below, if it is cloudy, you follow the
arrow down near the word yes if it is not cloudy you follow the arrow to the
right near the word no.
ARROW
Show relationship between different
shapes.
Connect two or more parts of a flowchart, which are on the same page.
OFF PAGE CONNECTOR
Connects two parts of a flowchart which are spread over different pages.
INPUT/OUTPUT
Input and output are the fundamental building blocks of a process used to describe a software program .for ex. the input could be provided by user like at an ATM machine or in a form online or it could data provided by an instrument like a temperature read .the program will have code to interpret the input and generate an output. the output could be a series of things: a message printed on a the user interface or data handed off to another process.
#SAP
#COMPUTICSPLUS
No comments:
Post a Comment