• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
10 data structures
 

10 data structures

on

  • 3,602 views

 

Statistics

Views

Total Views
3,602
Views on SlideShare
3,602
Embed Views
0

Actions

Likes
0
Downloads
173
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    10 data structures 10 data structures Document Transcript

    • Data Structures and Algorithms Sequential Search @ There are instances when you do not know the element number, but you do know the value of the element. In this case a search must be made on the array to find the correct element. The easiest way to search an array is called a sequential search.Data Structures *Property of STI Page 1 of 49
    • Data Structures and Algorithms Binary SearchData Structures *Property of STI Page 2 of 49
    • Data Structures and Algorithms Binary SearchExample of a Binary Search A 1 5 2 7 Order of comparisons to find the element number of 44: 3 9 4 12 1. Element 7 (UB = 13, LB = 1, Element 5 15 Number = 7) 2. Element 10 (UB = 13, LB = 8, Element 6 Number 10) 20 7 25 3. Element 12 (UB = 13, LB = 11, 8 28 Element Number = 12) 9 33 Number 44 is found in three comparisons, 10 35 compared to 12 with the sequential 11 40 search. 12 44 13 47Data Structures *Property of STI Page 3 of 49
    • Data Structures and Algorithms Pointer TechniqueData Structures *Property of STI Page 4 of 49
    • Data Structures and Algorithms Pointer TechniqueData Structures *Property of STI Page 5 of 49
    • Data Structures and Algorithms Pointer TechniqueData Structures *Property of STI Page 6 of 49
    • Data Structures and Algorithms Pointer Technique The element number of the frequency distribution array is the number of points correct and the value of the element is the number of students that received that grade. Therefore, the frequency distribution array F shows that there is 1 student who received 1 point, 1 that received 2 points, 2 that received 3 points, 1 that received 4 points, 1 that received 5 points, 3 that received 6 points, 4 that received 7 points, 5 that received 8 points, 6 that received 9 points and 6 that received 10 points.Data Structures *Property of STI Page 7 of 49
    • Data Structures and Algorithms Cross-TabulationData Structures *Property of STI Page 8 of 49
    • Data Structures and Algorithms Cross-TabulationData Structures *Property of STI Page 9 of 49
    • Data Structures and Algorithms Cross-TabulationData Structures *Property of STI Page 10 of 49
    • Data Structures and Algorithms Cross-TabulationData Structures *Property of STI Page 11 of 49
    • Data Structures and Algorithms Cross-TabulationData Structures *Property of STI Page 12 of 49
    • Data Structures and Algorithms Cross-TabulationData Structures *Property of STI Page 13 of 49
    • Data Structures and Algorithms Cross-TabulationData Structures *Property of STI Page 14 of 49
    • Data Structures and Algorithms Sorting TechniquesSelection Exchange Sort Technique@ Sorting – is the process of putting data in alphabetical or numeric order using one key field or a concatenation of two or more fields. Data are sorted according to the primary key. Once the data are in order, they can be accessed by various means, including the sequential search and the binary search.Data Structures *Property of STI Page 15 of 49
    • Data Structures and Algorithms Sorting TechniquesThe Selection Exchange SortData Structures *Property of STI Page 16 of 49
    • Data Structures and Algorithms Sorting TechniquesFlowchart and Algorithm for SWAP ModuleData Structures *Property of STI Page 17 of 49
    • Data Structures and Algorithms Sorting Techniques Example Pass, I = 1Data Structures *Property of STI Page 18 of 49
    • Data Structures and Algorithms Sorting TechniquesBubble SortData Structures *Property of STI Page 19 of 49
    • Data Structures and Algorithms Sorting TechniquesFlowchart and Algorithm for Bubble SortData Structures *Property of STI Page 20 of 49
    • Data Structures and Algorithms Sorting TechniquesShell SortData Structures *Property of STI Page 21 of 49
    • Data Structures and Algorithms Sorting TechniquesAlgorithm and Flowchart for the Shell SortData Structures *Property of STI Page 22 of 49
    • Data Structures and Algorithms Stacks @ A Stack is a list of numbers, such as an array of numbers, to which all additions are at one end and all deletions are at the same end. This is a last-in, first-out procedure. When a value (X) is added to the stack it is called pushing the stack. When a value (X) is used from the stack it is called popping the stack. PUSH 3 PUSH 4 PUSH 7 POP X POP X PUSH 6Data Structures *Property of STI Page 23 of 49
    • Data Structures and Algorithms StacksExample of a Stack That Has Been Pushed andPoppedData Structures *Property of STI Page 24 of 49
    • Data Structures and Algorithms StacksAlgorithm and Flowchart to Push and Pop a StackData Structures *Property of STI Page 25 of 49
    • Data Structures and Algorithms Linked List@ A Linked List is a file in which each record points to its successor, except for the last record, which has an end-of-list indicator.@ The method of pointing to the next record is a field, which contains the record number of the next record in order. This is called the linking field, since the value in this field links the records in proper order.Example of an Initially Created Linked ListData Structures *Property of STI Page 26 of 49
    • Data Structures and Algorithms Linked ListExample of A Linked List After Multiple Adds andDeletionsData Structures *Property of STI Page 27 of 49
    • Data Structures and Algorithms Linked ListOriginal File Comment: Notice that records 5 and 9 are records that have been deleted in the past and are included in the empty list, even though there are data in the record. The used list skips these records .Data Structures *Property of STI Page 28 of 49
    • Data Structures and Algorithms Linked ListFile After The Additions and DeletionsData Structures *Property of STI Page 29 of 49
    • Data Structures and Algorithms Linked List Add 69Data Structures *Property of STI Page 30 of 49
    • Data Structures and Algorithms Linked List Delete 17Data Structures *Property of STI Page 31 of 49
    • Data Structures and Algorithms Linked List Delete 44Data Structures *Property of STI Page 32 of 49
    • Data Structures and Algorithms Linked List Add 37Data Structures *Property of STI Page 33 of 49
    • Data Structures and Algorithms Linked List Delete 29Data Structures *Property of STI Page 34 of 49
    • Data Structures and Algorithms Linked List Add 40Data Structures *Property of STI Page 35 of 49
    • Data Structures and Algorithms Linked List Add 90Data Structures *Property of STI Page 36 of 49
    • Data Structures and Algorithms Linked List Add 1Data Structures *Property of STI Page 37 of 49
    • Data Structures and Algorithms Linked List Add 16Data Structures *Property of STI Page 38 of 49
    • Data Structures and Algorithms Linked ListAlgorithm and Flowchart to Create a Linked ListData Structures *Property of STI Page 39 of 49
    • Data Structures and Algorithms Linked ListAlgorithm and Flowchart for Processing andUpdating a Linked ListData Structures *Property of STI Page 40 of 49
    • Data Structures and Algorithms Linked ListData Structures *Property of STI Page 41 of 49
    • Data Structures and Algorithms Linked ListData Structures *Property of STI Page 42 of 49
    • Data Structures and Algorithms Linked ListData Structures *Property of STI Page 43 of 49
    • Data Structures and Algorithms Linked ListData Structures *Property of STI Page 44 of 49
    • Data Structures and Algorithms Linked ListData Structures *Property of STI Page 45 of 49
    • Data Structures and Algorithms Linked ListData Structures *Property of STI Page 46 of 49
    • Data Structures and Algorithms Linked ListData Structures *Property of STI Page 47 of 49
    • Data Structures and Algorithms Linked ListData Structures *Property of STI Page 48 of 49
    • Data Structures and Algorithms Linked ListData Structures *Property of STI Page 49 of 49