Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Name = Muhammad Ahtesham

Reg no= FA18-BCS-031

Definition of data structure


A data structure is specialized format for organizing, processing, retrieving and storing data. While there
are several basic and advanced structure types, any data structure is designed to arrange data to suit a
specific purpose so that it can be accessed and worked with in appropriate ways.

Characteristics of data structure


1. Linear or non linear: whether the data items are arranged in chronological sequence. Such as
with an array, or in an unordered sequence, such as with a graph.
2. Homogenous or non homogenous: describe whether all data items in a given repository are of
the same type or of various types.
3. Static or dynamic: how the data structure compiled. Static data structure have fixed sizes,
memory location at compile time. Dynamic data structure have sizes, structure, and memory
locations that can shrink expand depending on the use.

Types of data structure


1. Arrays: an array stores a collection of items at adjoining memory locations. Items that are
same type get stored together so that position of each element can be calculated or
retrieved easily. Arrays can be fixed or flexible in length.
2. Stacks: a stack store a collection of items in the linear order that operation are applied. This
order could be last in first out (LIFO) or first in first out (FIFO).
3. Queues: a queue stores a collection of item similar to a stack however the operation order
can only be first in first out.
4. Linked lists: a linked list is collection of items in a linear order. Each element or node, in a
linked list contain a data item as well as a reference or link to the next item in the list.
5. Trees: a tress is a collection of item in an abstract, hierarchical way. Each node to link other
node and can have multiple sub-value. Is also known as children.
6. Graphs: a graph stores a collection of item in a non-linear fashion. Graph made up of set of
nodes also known as vertices and line connect them also known as edges.
7. Tries: a trie or keyword tree is data structure that stores string as a data items that can be
organized in a visual graph.
8. Hash tables: a hash map is stores a collection of items in an associative array that plots keys
to value. A hash table uses a hash function to convert an index into an array of buckets that
contain the desired data item.

Uses of data structure

In general, data structures are used to implement the physical form of abstract data types.

In programming languages data structure are used to organize code and information in a digital space.
For example, python lists and dictionaries or Javascript array and objects are common coding structure
used for storing and retrieving information.

Importance of data structure


Data structure is essential for managing large amounts of data, such as information kept in databases or
indexing services, efficiently. Proper maintenance of data system requires the identification of memory
allocation, data interrelationship and data processes all of which data structure help with.

You might also like