2. INTODUCTION
DATA STRUCHERS AND ALGORITHMS?
WHAT IS DATA?
In computing, DATA is a information that has been translated into a form that is efficient for
movement or processing.
WHAT IS DATA STRUCHERS?
DATA STRUCTURE is a particular way of organizing data in a computer so that it can be used
effectively.
Example:-Arrays, linked list, stack, queue, etc.
WHAT IS ALGORITHM?
In computing, ALGORITHM is a step-by-step procedure to be followed to reach the desired output.
Note:- Steps in an algorithm can use one or many data structure(s) to solve a problem.
4. DATA STRUCTURES TYPES
There are two types of data structures
1. primitive or built in data structures
2. Non primitive or user-defined data structures
primitive or built in data structures
Primitive data structure is a kind of data structure that stores the data of only one type.
Primitive data structure will contain some value, i.e., it cannot be NULL.
Example:-integer, character, float….,etc.
Non primitive or user-defined data structures
Non-primitive data structure is a type of data structure that can store the data of more than
one type.
Example:-non-primitive data structure are Array, Linked list, stack….,etc.
5. Non primitive or user-defined Data Structures
Non primitive data structures type (there are two types)
1. Linear data structures
2. Non-Linear data structures
Linear data structures
A Linear data structure have data elements arranged in sequential manner and each member
element is connected to its previous and next element.
Example:-List, Queue, Stack, Array etc.
Note:-Linear data structure are two types(static and dynamic)
Static:- Static data structures are storing a fixed number of data items.
Example:- Array
Dynamic:-dynamic data structure is flexibility to consume additional memory if needed or free up
memory when possible for improved efficiency.
Example:- List, Queue, Stack
7. Non-Linear DATA STRUCTURES
Non-Linear data structures
Non-linear data structure have data
elements are not arranged in a contiguous
manner. As the arrangement is non
sequential, so the data elements cannot be
traversed or accessed in a single run.
Example:-Trees,graphs,set..etc.
8. Linear and Non-Linear Diff…
Linear Data Structure –(basic terminology)
linear data structures, each element is linearly connected to each other having reference to the next and previous
elements. Arrays, linked list, stack, queue are the types of a linear data structure.
Non-Linear Data Structure –(basic terminology)
non-linear data structures, the elements are connected in a hierarchical manner. Trees and graphs are the types of
a non-linear data structure.
Linear Data Structure –(Implementation)
Implementation is quite easy as only a single level is involved.
Non-Linear Data Structure –(Implementation)
Implementation is much more complex as multiple levels are involved.
Linear Data Structure –(Memory utilization)
Wastage of memory is much more common in linear data structures.
Non-Linear Data Structure –(Memory utilization)
Memory is consumed wisely and there is almost no wastage of memory.
9. Linear and Non-Linear Diff…
Linear Data Structure –(Time complexity)
The time complexity of linear data structure increases with the increase in the input size.
Non-Linear Data Structure –(Time complexity)
The time complexity of non-linear data structure often remains same with the increase in the input size.
Linear Data Structure –(Applications)
Linear data structures are mainly used for developing the software.
Non-Linear Data Structure –(Applications)
Non-linear data structures are used in image processing and Artificial Intelligence.