DSA Introduction
DSA Introduction
Data types
A particular kind of data item, as defined by the values it can take, the programming
language used, or the operations that can be performed on it.
1
Primitive Data Structure
Primitive data structures are basic structures and are directly operated upon by machine
instructions.
Primitive data structures have different representations on different computers.
Integers, floats, character and pointers are examples of primitive data structures.
These data types are available in most programming languages as built-in type.
o Integer: It is a data type which allows all values without fraction part. We can use it for
whole numbers.
o Float: It is a data type which uses for storing fractional numbers.
o Character: It is a data type which is used for character values.
o Pointer: A variable that holds a memory address of another variable is called pointer.
2
o Sorting
o Merging
Examples of Linear Data Structure are Stack and Queue.
Stack: Stack is a data structure in which insertion and deletion operations are performed at
one end only.
o The insertion operation is referred to as ‘PUSH’, and deletion operation is referred to as
‘POP’ operation.
o The stack is also called as Last in First out (LIFO) data structure.
Queue: The data structure which permits the insertion at one end and Deletion at another
end, known as Queue.
o End at which deletion occurs is known as FRONT end, and another end at which insertion
occurs is known as REAR end.
o The queue is also called as First in First out (FIFO) data structure.
3
It updates or modifies the data in the data structure.
5. 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.
6. Sorting
Sorting is a process of arranging all data items in a data structure in a particular order, say for
example, either in ascending order or in descending order.
7. Merging
Merging is a process of combining the data items of two different sorted list into a single sorted
list.
8. Splitting
Splitting is a process of partitioning single list to multiple lists.
9. Traversal
Traversal is a process of visiting every node of a list systematically.