0% found this document useful (0 votes)
81 views18 pages

Lec 1

This document discusses data structures, including their definition, need, characteristics, types, uses, and importance. It defines data structures as particular ways of storing and organizing data for efficient retrieval and use. Common data structure types include arrays, stacks, queues, linked lists, trees, graphs, hash tables, and tries. Choosing the proper data structure is important for managing large amounts of data and designing efficient software.

Uploaded by

Haider
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views18 pages

Lec 1

This document discusses data structures, including their definition, need, characteristics, types, uses, and importance. It defines data structures as particular ways of storing and organizing data for efficient retrieval and use. Common data structure types include arrays, stacks, queues, linked lists, trees, graphs, hash tables, and tries. Choosing the proper data structure is important for managing large amounts of data and designing efficient software.

Uploaded by

Haider
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Data Structure

Lecture 1
Data Structure
 Data structure is a particular way of storing and organizing
information in a computer so that it can be retrieved and used most
productively.

 Data Structure is process through which we can collect and


organize data in best way as well as perform operation on that in
most effective way. If we have good understanding of data
structures then we are specialized in organizing and storing data.
Need of data structure
 We need a librarians and clerks to stack up the right books in right
places and to maintain a log of records for the same. Just imagine a
library with no librarian or clerks and the books were stacked up by
individuals from the public as and when they visited the library. The
books can be of any author, any category, any publication. So just
think of it now. How would you actually find a book in the library
when needed? Easy, just scan through all the books right?
 It is the same intuitions that led to the rise of data structures and
algorithms to arrange and process the data in the memory for
efficient storage, access and processing.
Characteristics of data structures
Data structures are often classified by their characteristics. Possible characteristics
are:
 Linear or non-linear: This characteristic describes whether the data items are
arranged in chronological sequence, such as with an array, or in an unordered
sequence, such as with a graph.
 Homogeneous or non-homogeneous: This characteristic describes whether all
data items in a given repository are of the same type or of various types.
 Static or dynamic: This characteristic describes how the data structures are
compiled. Static data structures have fixed sizes, structures and memory locations
at compile time. Dynamic data structures have sizes, structures and memory
locations that can shrink or expand depending on the use.
Types of data structures
Data structure types are determined by what types of operations are required or what kinds of
algorithms are going to be applied. These types include:
 Arrays- An array stores a collection of items at adjoining memory locations.
Items that are the same type get stored together so that the position of each
element can be calculated or retrieved easily. Arrays can be fixed or flexible in
length.
 Stacks- A stack stores a collection of items in the linear order that operations are
applied. This order can be last in first out (LIFO).
 Queues- A queue stores a collection of items similar to a stack; however, the
operation order can be first in first out (FIFO).
 Linked lists- A linked list stores a collection of items in a linear order. Each
element, or node, in a linked list contains a data item as well as a reference, or
link, to the next item in the list.
Types of data structures
 Trees- A tree stores a collection of items in an abstract, hierarchical way. Each
node is linked to other nodes and can have multiple sub-values, also known as
children.
 Graphs- A graph stores a collection of items in a non-linear fashion. Graphs
are made up of a finite set of nodes, also known as vertices, and lines that
connect them, also known as edges. These are useful for representing real-life
systems such as computer networks.
 Hash tables- A hash table, or a hash map, stores a collection of items in an
associative array that plots keys to values. A hash table uses a hash function to
convert an index into an array of buckets that contain the desired data item.
Types of data structures

 Tries- A trie, or keyword tree, is a data structure that stores strings as data
items that can be organized in a visual graph.
 All the above types of DS are non-primitive. These are considered
complex data structures as they can store large amounts of interconnected
data.
 Examples of primitive, or basic, data structures are integers,
floats, Booleans and characters.
Stack
Queues
Linked List
Tree
Graph
Hash Table
Tries
Uses of data structures
 In general, data structures are used to implement the physical forms
of abstract data types. This can be translated into a variety of
applications, such as displaying a relational database as a binary
tree.
 Data structures are also a crucial part of designing efficient
software.
Importance of data structures

 Data structures are essential for managing large amounts of data, such as
information kept in databases or indexing services, efficiently. Proper
maintenance of data systems requires the identification of memory allocation,
data interrelationships and data processes, all of which data structures help with.
 Additionally, it is not only important to use data structures but it is important to
choose the proper data structure for each task. Choosing an ill-suited data
structure could result in slow runtimes or unresponsive code. A few factors to
consider when picking a data structure include what kind of information will be
stored, where should existing data be placed, how should data be sorted and
how much memory should be reserved for the data.
References

 Book: Data Structures by Richard F. Gilberg, Behrouz A. Forouzan


 https://www.quora.com/Why-do-we-need-data-structures-1
 https://searchsqlserver.techtarget.com/definition/data-structure

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy