BIG JAVA: LATE OBJECTS
BIG JAVA: LATE OBJECTS
2nd Edition
ISBN: 9781119626220
Author: Horstmann
Publisher: WILEY
Expert Solution & Answer
Book Icon
Chapter 14, Problem 6RE

Explanation of Solution

Given:

The algorithm A to handle a data set of 1000 records it will take around five seconds.

The algorithm A is considered as O(n) algorithm.

To handle data set of 2000 records:

The algorithm is considered as O(n) algorithm.

20001000=2=2×5=10

The algorithm is considered as O(n2) algorithm.

2000210002=4=4×5=20

The algorithm is considered as O(n3) algorithm.

2000310003=8=8×5=40

The algorithm A is considered as O(n log (n)) algorithm.

2000 log(2000)1000log(1000)=2×3.471×3=2.31=2.31×5=11.56

To handle data set of 3000 records:

The algorithm is considered as O(n) algorithm.

30001000=3=3×5=15

The algorithm is considered as O(n2) algorithm.

3000210002=9=9×5=45

The algorithm is considered as O(n3) algorithm.

3000310003=2=27×5=135

The algorithm A is considered as O(n log (n)) algorithm

Blurred answer

Chapter 14 Solutions

BIG JAVA: LATE OBJECTS

Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education