# Question 1

(a) Define data structure. List the various linear and non-linear data structures and explain them in brief.
``` The possible ways in which the data items or atoms are logically related define datastructures.Linear Data Structures: Array, Stack, Queue, Linked List.Non-Linear Data Structures: Tree, Graph.Following are the Linear Data Structures:Array: An array is an ordered set which consists of a fixed number of objects. Nodeletion or insertion operations are performed on arrays.Stack: A collection of items in which only the most recently added item may beremoved. The latest added item is at the top. Basic operations are push and pop. Alsoknown as "last-in, first-out" or LIFO.

Queue: A collection of items in which only the earliest added item may be accessed.Basic operations are add (to the tail) or enqueue and delete (from the head) or dequeue.Delete returns the item removed. Also known as "first-in, first-out" or FIFO.

Linked List: A list implemented by each item having a link to the next item.Following are the Non-Linear Data Structures:Tree: A data structure accessed beginning at the root node. Each node is either a leaf oran internal node. An internal node has one or more child nodes and is called the parentof its child nodes. All children of the same node are siblings. Contrary to a physical tree,the root is usually depicted at the top of the structure, and the leaves are depicted at thebottom.Graph: A

Graph: A set of items connected by edges. Each item is called a vertex or node.Formally, a graph is a set of vertices and a binary relation between vertices, adjacency.

```
(b) Discuss the basic operations performed with linear structure.
``` Following are the basic operations with linear structure:1.) Traversing: It means passing through the every element one by one which stored inthe particular structure.2.) Insertion: It means to insert an element in the particular structure.3.) Deletion: It means to delete an element in the particular structure.4.) Searching: It means to find desired element which is stored in the particularstructure.5.) Sorting: It means to arrange the elements of the particular structure inascending/descending order.
```