## Data Structures and Other Objects Using JavaThis text uses a five-step method for working with data types, to ensure students have a thorough knowledge of the subject and understand the data type abstractly. It also aims to teach students how to use the data type, design and implement it, and analyze the implementation. |

### From inside the book

Results 1-3 of 15

Page 607

FIGURE 12.2

data[ ], int first, int n) Sort an array of integers from smallest to largest. Parameters:

data - the array to be sorted f i rst - the start index for the portion of the array ...

FIGURE 12.2

**Mergesort**Specification ♢**mergesort**public static void**mergesort**(intdata[ ], int first, int n) Sort an array of integers from smallest to largest. Parameters:

data - the array to be sorted f i rst - the start index for the portion of the array ...

Page 613

the scope of this book, but we can give the final result and hint at its derivation.

First the result:

**Mergesort**— Analysis A complete analysis of**mergesort's**running time is beyondthe scope of this book, but we can give the final result and hint at its derivation.

First the result:

**Mergesort**Running Time The worst-case running time, the ...Page 624

worst-case running time for quicksort is 0(n2) . That makes

preferable to quicksort. However,

requires an ...

**Mergesort**also has a worst-case running time that is 0(n log n), whereas theworst-case running time for quicksort is 0(n2) . That makes

**mergesort**soundpreferable to quicksort. However,

**mergesort**requires more storage since itrequires an ...

### What people are saying - Write a review

User Review - Flag as inappropriate

trtgfhh

### Contents

Chapter | 2 |

LEARNING OBJECTIVES | 14 |

Chapter Summary and Solutions | 38 |

Copyright | |

25 other sections not shown

### Other editions - View all

### Common terms and phrases

Accessor method activated addAll algorithm applet arithmetic overflow array B-tree binary search tree binary tree BTNode Celsius clone method collection class computation constructor contains copy create current element cursor data type digits double numbers empty example expression extended class Figure graph hash table head reference heap heapsort Indicates insufficient memory information hiding initial capacity input IntArrayBag integer IntNode iterator Java Javadoc linked list Location loop manyItems mergesort method returns node null reference number of elements number of operations package parameter position Postcondition pre-order traversal Precondition priority queue private instance variables pseudocode public boolean public class public int public Object public static void public void quicksort recursive call reference variable remove return value returns true root Self-Test Exercises sequence shown simulation specified stack statement step stored string subtree Suppose target Throttle Throws TreeMap vertex vertices write zero