Map - PowerPoint PPT Presentation

About This Presentation
Title:

Map

Description:

Congo 2718 Niger 2590. Danube 1776 Nile 4160. Euphrates 1700 Rio Grande 1900 ... Niger. Nile. Figure 14.6 Example of trees. Size. Natural. logarithm. Ratio ... – PowerPoint PPT presentation

Number of Views:85
Avg rating:3.0/5.0
Slides: 10
Provided by: Gate8
Category:
Tags: map | niger

less

Transcript and Presenter's Notes

Title: Map


1
Map
Collection
SortedMap
List
Set
SortedSet
Figure 14.1 The Collection interfaces
2
Before adding
After adding
Add position
Figure 14.2 Adding an element at the end of an
ArrayList
3
 
 
 
index
 
49
50
51
52
53
 
9999
10000
Before adding
 
...
today
today
today
today
... ...
today
 
 
today
 
 
 
 
 
 
 
 
 
 
 
 
today
After adding
 
 
today
today
today
today
today
today
...
...
Figure 14.3 Add an element at position 50 in an
ArrayList
4
 
Figure 14.4 Finding element 5000 in a linked list
5
  • Amazon 4000 Indus 1800
  • Chang (Yangtze) 3964 Mekong 2600
  • Colorado 1450 Mississippi 2340
  • Columbia 1243 Missouri 2315
  • Congo 2718 Niger 2590
  • Danube 1776 Nile 4160
  • Euphrates 1700 Rio Grande 1900
  • Ganges 1560 Volga 2290
  • Huang (Yellow) 3395
  •  

Figure 14.5 Rivers of the world and their lengths
(in miles)
6
a. unbalanced
b. balanced
Figure 14.6 Example of trees
7
Size
Natural logarithm
Ratio
Observed time
Predicted time
Figure 14.7 Predictions based on ln n efficiency
8
  • / Groups fields for a name/
  • Uses toString to display
  • /
  • package personData
  • public class Name
  • String first
  • char initial
  • String last
  • public Name(String f, String l)
  • first f
  • last l
  • public String toString()
  • if (initial '\u0000')
  • return first " " last
  • else
  • return first " " initial " " last

Figure 14.8 A Name class
9
Name president new Name(George, Washington)
Name first new Name(George, Washington)
president
George, Washington
first
George, Washington
Figure 14.9 Two Name instances
Write a Comment
User Comments (0)
About PowerShow.com