Data Structures and types


Data structure means how the data is organized in memory. There different kind of data structures. Some are used to store the data of same type and some for different types of data. Different types of data structures help different types of operations of data structures too. Data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.
The simplest type of data structure is a linear array. It means a list of finite number n of elements referenced respectively by a set of n consecutive numbers, usually 1,2,3,…,n. If we choose the name A for the array then the elements of A are denoted by subscript notation as a1, a2, a3,…, an , or by parenthesis notation A(1), A(2), A(3),…, A(n) or by bracket notation A[1], A[2], A[3],… ,A[n].

Linked List:
In computer science, a linked list is a data structure that consists of a sequence of data records such that in each record there is a field that contains a reference (that is, a link) to the next record in the sequence. In other words, A simple linear data structure, each of whose nodes includes pointers to the previous and subsequent nodes in the list, enabling traversal of the structure from any starting point.

Data frequently contain a hierarchical relationship between various elements. The data structure which reflects this relationship is called a rooted tree graph or simply a tree. This is sometimes like the properties of an object. For example, properties to store of an employee in the office directory can be name, age, sex, salary etc. Again the properties “name” can have sub-properties like first name, middle name, last name etc.

A stack, also called a Last-In-First-Out (LIFO) system, where insertion and deletion can take place only at one end called the top.

A queue, also called a First-In-First-Out (FIFO) system is a linear list where deletions will take place only at the front end and insertions will take place only at the rear end. In the following figure we can see a pipe with two ends, left end is the rear end and right end is the front end. We are inserting some balls and those balls can only be inserted from the rear and they can come out (deletions) from the front end.


graph is a set of objects that are connected by links i.e edges and objects i.e vertices.graph has two types: directed and undirected graph. Data is represented in the pictorial form connected by edges where two algos can be performed depth first search and breadth first serach