Intro ds

1,015 views

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,015
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
94
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Intro ds

  1. 1. INTRODUCTION TO DATA STRUCTURES AND ALGORITHM
  2. 2. <ul><li>Define : A Procedure or method or recipe or formula or set of steps that can be used by a computer for the solution of a problem </li></ul><ul><li>It is a specific set of rules to obtain a definite output from specific inputs provide to the problem </li></ul>WHAT IS ALGORITHM ?
  3. 3. WHAT IS DATA STRUCTURE? <ul><li>1. A Data structure is a particular way of storing and organizing data in a computer. So that it can be used efficiently. </li></ul><ul><li>2. Data structures deals with the study of methods, techniques and tools to organize or structure data </li></ul>
  4. 4. <ul><li>Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. </li></ul><ul><li>For example, B-trees are particularly well-suited for implementation of databases , while compiler implementations usually use hash tables to look up identifiers. </li></ul>
  5. 5. <ul><li>Data structures are used in almost every program or software system. Data structures provide a means to manage huge amounts of data efficiently, such as large databases and internet indexing services. </li></ul><ul><li>Usually, efficient data structures are a key to designing efficient algorithms </li></ul>
  6. 6. <ul><li>ABSTRACT DATA TYPES [ADT] </li></ul><ul><li>WHAT IS DATA TYPES? </li></ul><ul><li>A data type refers to the type of values that variables in a programming language hold. </li></ul><ul><li>WHAT IS ADT? </li></ul><ul><li>Abstract data type refers to the data objects (refers to the list of elements such as list of integers or list of alphabetical strings) which comprise the data structure, and their fundamental operations. </li></ul>
  7. 7. <ul><li>An ADT promotes data abstraction and focuses on what a data structure does rather than how it does </li></ul>
  8. 8. <ul><li>CLASSIFICATION OF DATA STRUCTURES </li></ul>DATA STRUCTURES Non-Linear Linked Sequential Linear <ul><li>Arrays </li></ul><ul><li>Stacks </li></ul><ul><li>Queues </li></ul><ul><li>Priority queues </li></ul><ul><li>Linked Lists </li></ul><ul><li>Linked Stacks </li></ul><ul><li>Linked Queues </li></ul><ul><li>Trees </li></ul><ul><li>Graphs </li></ul>
  9. 9. <ul><li>Linear data structures are unidimensional in structure and represent linear lists. </li></ul><ul><li>Non-linear data structures are two-dimensional representation of data lists </li></ul>
  10. 10. ARRAYS
  11. 11. <ul><li>WHAT IS ARRAY? </li></ul><ul><li>An array is an ADT whose objects are sequence of elements of the same types and the two operations performed on it are store and retrieve. </li></ul><ul><ul><ul><ul><ul><li>STORE(list, i, e) </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>RETRIEVE(list , i ) </li></ul></ul></ul></ul></ul>
  12. 12. TYPES OF ARRAY <ul><li>One-dimensional A[1:5] </li></ul><ul><li>Two dimensional B[1:3][1:4] </li></ul><ul><li>Multi dimensional C[1:3][1:6][1:8]…. </li></ul>
  13. 13. STACK
  14. 14. <ul><li>A stack is a last in, first out (LIFO) abstract data type and data structure. </li></ul><ul><li>A stack can have any abstract data type as an element </li></ul><ul><li>It is characterized by only three fundamental operations: push , pop and stack top . </li></ul><ul><li>The push operation adds a new item to the top of the stack, or initializes the stack if it is empty. </li></ul>
  15. 15. <ul><li>If the stack is full and does not contain enough space to accept the given item, the stack is then considered to be in an overflow state. </li></ul><ul><li>The pop operation removes an item from the top of the stack. A pop either reveals previously concealed items, or results in an empty stack, </li></ul><ul><li>But if the stack is empty then it goes into underflow state (It means no items are present in stack to be removed). </li></ul>
  16. 16. <ul><li>The stack top operation gets the data from the top-most position and returns it to the user without deleting it. The same underflow state can also occur in stack top operation if stack is empty. </li></ul>
  17. 17. <ul><li>A stack is a restricted data structure , because only a small number of operations are performed on it . The nature of the pop and push operations also means that stack elements have a natural order. Elements are removed from the stack in the reverse order to the order of their addition: therefore, the lower elements are those that have been on the stack the longest. </li></ul>
  18. 18. <ul><li>Implementation of push operation on a stack </li></ul><ul><li>Procedure PUSH(STACK,n,top,item) </li></ul><ul><li>if(top=n) then </li></ul><ul><li>STACK_FULL; </li></ul><ul><li>else </li></ul><ul><li> { </li></ul><ul><li>top=top+1; </li></ul><ul><li>STACK[top]=item; </li></ul><ul><li> } </li></ul><ul><li>end PUSH </li></ul>
  19. 19. <ul><li>Implementation of pop operation on a stack </li></ul><ul><li>Procedure POP(STACK,top,item) </li></ul><ul><li>if(top=0) then </li></ul><ul><li>STACK_EMPTY; </li></ul><ul><li>else </li></ul><ul><li> { </li></ul><ul><li>item=STACK[top]; </li></ul><ul><li>top=top-1; </li></ul><ul><li> } </li></ul><ul><li>end POP </li></ul>
  20. 20. QUESTIONS ?
  21. 21. THANK YOU

×