0

90kviews

Explain different types of data structures with an example

**1 Answer**

0

90kviews

Explain different types of data structures with an example

4

5.2kviews

written 8.0 years ago by |

- Data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently. So, it is a special format for organizing and storing data. Arrays, linked lists, trees, graphs, etc. are all data structures.
- Here are different types of data structures:-

**Array:**It consists of a collection of elements, each identified by a common variable name and an index. A block of continuous memory is assigned for an array. Arrays may be one-dimensional or multidimensional

**Linked List:**It consists of a group of nodes together which represent a sequence. It consists of two main parts: the data and a pointer pointing to the next node in the list. The start is marked by head pointer and the end is denoted by null pointer.

.

**Tree:**It has a set of nodes which have data and pointers or references. The pointers point to the children nodes of the node. The constraint is that no reference is duplicated and no node points to the root.

**Graph:**Itâ€™s a collection of a set of vertices V and a set of edges E. Each edge E is a pair (v, w) where v and w are elements of V (i.e. they are vertices).

ADD COMMENT
EDIT

Please log in to add an answer.