Data Structure
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.
• Different kinds of data structures are meant
for different kinds of applications, and some
are highly specialized to specific tasks.
Data structures are important for the following
reasons:
• Data structures are used in almost every program or software
system.
• Specific data structures are essential ingredients of many
efficient algorithms, and make possible the management of
huge amounts of data, such as large integrated collection of
databases.
• Some programming languages emphasize data structures,
rather than algorithms, as the key organizing factor in
software design.
Stack
• LIFO- Last In First Out
• Undo functions use this to pop most recent
action off top of stack, then second most
recent, etc.
Queue
• FIFO – First In First Out
• Process Scheduling normally uses a queue
• A queue is often used to save a group of data in an
organized structure so that it is easily accessed
immediately when needed since its a FIFO (First in first
out).
• However; when filling information into that queue
when that queue is FULL the rest of the information is
lost. To combat this circular queue is used, which
overwrites the other elements so that recent data
is NOT lost.
• An example of this like you mentioned would be the
queue of resources of a computer.
• Because a computer does not have infinite resources a
queue has to be used in order to allocate resources to
those that need it.
• For instance a process would request some resources
and it would be thrown into the queue and be given a
priority level, based on this information the OS would
then make a decision how many resources it needs and
how much time it will be given. In order to allow
multiple processes to make use of this, any process
that has processing that needs to be done will put in a
request in that queue
Tree
• Tree
Directory traversal
• Binary Search Tree
Searching quickly for a given element
Graphs
• Stores data so that you can think of it as a
mathematical "plane" where the data is
plotted.
• It is effective at representing (possibly) very
complicated relationship between data, since
multiple "links" can exist between more than
two pieces of data, as opposed to a linked list
where you can only have a link to your left and
to your right.
Linked Lists
• Singly linked list offers movement in one
direction between elements
• doubly linked list offers movement back and
forth between elements
• Circular linked list offers Circular navigation of
similar objects (processes are one example)
– Use this when you want to be able to navigate
between elements, because each element is
linked to the next one and the one before it
• A photo slide show that goes to the next or
previous photo and then eventually starts at
the beginning can be thought of as a circular
linked list.
• Depending on the style of the linked list, this
allows forward traversal backward traversal, or
both directions.
• One thing to note is that a linked list can be
dynamic in terms of size since all that needs to be
done to add a new note is just attach it to the end
of the list.
• However; in terms of performance the speed of
that would be O (N) which means that the
performance is heavily dependent on the size of
the list.
ARRAYS
• Arrays are linear data structures consisting of
a group of elements that are accessed by
indexing. In most programming languages
each element of array has the same data type
and the array occupies a contiguous area of
storage.
Practical Usage of Data Structures in
Computers
• Stack - any recursive call
• Queue, Circular Queue - all the FIFO algo use
this
• Linked List, Doubly Linked list, Circular Linked
list - all the RDBMS
• Tree, Binary Search Tree - Where searching is
required. Memory is stored in B tree
• Graph - Google Maps

Data Structure - Complete Basic Overview.ppt

  • 1.
  • 2.
    Data Structure • Datastructure is a particular way of storing and organizing information in a computer so that it can be retrieved and used most productively. • Different kinds of data structures are meant for different kinds of applications, and some are highly specialized to specific tasks.
  • 3.
    Data structures areimportant for the following reasons: • Data structures are used in almost every program or software system. • Specific data structures are essential ingredients of many efficient algorithms, and make possible the management of huge amounts of data, such as large integrated collection of databases. • Some programming languages emphasize data structures, rather than algorithms, as the key organizing factor in software design.
  • 4.
    Stack • LIFO- LastIn First Out • Undo functions use this to pop most recent action off top of stack, then second most recent, etc.
  • 5.
    Queue • FIFO –First In First Out • Process Scheduling normally uses a queue • A queue is often used to save a group of data in an organized structure so that it is easily accessed immediately when needed since its a FIFO (First in first out). • However; when filling information into that queue when that queue is FULL the rest of the information is lost. To combat this circular queue is used, which overwrites the other elements so that recent data is NOT lost.
  • 6.
    • An exampleof this like you mentioned would be the queue of resources of a computer. • Because a computer does not have infinite resources a queue has to be used in order to allocate resources to those that need it. • For instance a process would request some resources and it would be thrown into the queue and be given a priority level, based on this information the OS would then make a decision how many resources it needs and how much time it will be given. In order to allow multiple processes to make use of this, any process that has processing that needs to be done will put in a request in that queue
  • 7.
    Tree • Tree Directory traversal •Binary Search Tree Searching quickly for a given element
  • 8.
    Graphs • Stores dataso that you can think of it as a mathematical "plane" where the data is plotted. • It is effective at representing (possibly) very complicated relationship between data, since multiple "links" can exist between more than two pieces of data, as opposed to a linked list where you can only have a link to your left and to your right.
  • 9.
    Linked Lists • Singlylinked list offers movement in one direction between elements • doubly linked list offers movement back and forth between elements • Circular linked list offers Circular navigation of similar objects (processes are one example) – Use this when you want to be able to navigate between elements, because each element is linked to the next one and the one before it
  • 10.
    • A photoslide show that goes to the next or previous photo and then eventually starts at the beginning can be thought of as a circular linked list.
  • 11.
    • Depending onthe style of the linked list, this allows forward traversal backward traversal, or both directions. • One thing to note is that a linked list can be dynamic in terms of size since all that needs to be done to add a new note is just attach it to the end of the list. • However; in terms of performance the speed of that would be O (N) which means that the performance is heavily dependent on the size of the list.
  • 12.
    ARRAYS • Arrays arelinear data structures consisting of a group of elements that are accessed by indexing. In most programming languages each element of array has the same data type and the array occupies a contiguous area of storage.
  • 13.
    Practical Usage ofData Structures in Computers • Stack - any recursive call • Queue, Circular Queue - all the FIFO algo use this • Linked List, Doubly Linked list, Circular Linked list - all the RDBMS • Tree, Binary Search Tree - Where searching is required. Memory is stored in B tree • Graph - Google Maps