DS Online Class Material Module 1 - 1
DS Online Class Material Module 1 - 1
Definition:
Primitive data structures are the fundamental data types which are supported
by a programming language.
The term ‘data type’, ‘basic data type’ and ‘primitive data type’ are often used
interchangeably.
Non-primitive Data Structures:
Non-primitive data structures are those data structures which are created
In Non-linear data structures, the elements of a data structure are not stored
in a sequential order.
Character Stacks
Queues
Boolean
Trees
Graphs
Boolean: It is used to store true or false. Every non-zero value corresponds to true and
0 value corresponds to false and it is denoted by keyword ‘bool’.
Stacks: A stack is a linear data structure in which insertion and deletion of elements
are done at only one end, which is known as the top of the stack. Stack is also called as
Last-In, First-Out (LIFO).
Queues: A queue is a linear data structure in which the element that is inserted first is
the first one to be taken out. The elements in a queue are added at one end called the
rear and removed from the other end called the front. Queue is also called as First-In,
First-Out (FIFO).
Linked Lists: A linked list is a set of dynamically allocated nodes, arranged in such a
way that each node contains one value and one pointer. The pointer always points to
the next member of the list. If the pointer is NULL, then it is the last node in the list.
Non-primitive Data Structures (Contd…):
arranged in a hierarchical order. One of the nodes is designated as the root node and
the remaining nodes can be partitioned into disjoint sets such that each set is a sub-
structures are
Traversing
Searching
Inserting
Deleting
Sorting
Merging
Traversing: It means to access each data item exactly once so that it can be
processed.
Searching: It is used to find the location of one or more data items that satisfy
the given constraint. Such a data item may or may not be present in the given
Example: To find the names of all the students who secured 100 marks in
subject.
Inserting: It is used to add new data items to the given list of data items.
Example: To add the details of a new student who has recently joined the
course.
Deleting: It means to remove (delete) a particular data item from the given
Example: To delete/remove the name of a student who has left the course.
Sorting: Data items can be arranged in some order like ascending order or
Merging: Combing the records in two different sorted files into single sorted
file.
Today’s Class Assignment Questions.
Note: Write these assignment questions in 200 pages RULED long note book.
operations.
THANK YOU