It 265 Data Structures Phase 5 Essay

3715 Words Feb 2nd, 2015 15 Pages
IT 265 Data Structures for Problem Solving
Data Structures and Methods

9/20/2014
Phase 5

Contents Executive Summary 4 Phase 1 4 Phase 2 4 Phase 3 4 Phase 4 4 Phase 5 5 Section 1: Lists, Stacks, and Queues 6 Stacks 6 Queues 10 Section 2: Hashing, Heaps and Trees 14 Section 3: Sorting Algorithms 20 Insertion sort 20 Bubble Sort 20 Selection sort 21 Section 4: Searching 22 Array 22 Linked Lists 23 Section 5: Recursion 30 References 33

Executive Summary
Phase 1 A list is a collection of items in which the items have a position (Weiss, 2010). A linked list allows data to be input or removed easily because each of the data items in the list is connected to its neighbor by a pointer
…show more content…
(faculty.kfupm.edu)

// Implementation of StackAsLinkedList //
Public class Pet Details public static void main (string [],int ) {
}
//push link list nodes to stack
For (int node =0; node < Pet Details.size( ); nodes ++
Private String dogName;
Private int dogAge;
List<Pet Details> ={“Blue” 12, “Ruby” 9, “Jasper” 1, “Tanner” 2, “Olive” 5 }
Public StackAsLinkedList(string dogName, int dogAge,) { this.dogName = dogName; this.dogAge = dogAge; Extends AbstractContainer Implements Stack {
Protected MyLinkedList list;
Public StackAsLinkedList ( ) { List = new MyLinkedList ( ); this.dogName = “ “; this.dogAge = “ “;
}
Public void push (Object obj) { List.add (obj); Count ++;
}
Public Object pop ( ) { If (count == 0) Throw new ContainerEmptyException ( ); Else { Object obj = list.getFirst ( ); List.extractFirst ( ); Count--; Return obj; }
}
Public object next ( ) { If (position == null) Throw new NoSuchElementException ( );
Else
Object obj = position.getData ( ); Position = position.getnext ( ); Return obj; } Public void printPet Details ( ) {
System.out.println(“dogName: “ + this. dogName); System.out.println(“dogAge: “ + this.dogAge);
}
}
Blue
12
Ruby
9
Jasper
1
Tanner
2
Olive
5

Queues A

Related Documents