For this task, save your work in hw2.pdf In class, our ArrayList implementation uses the array doubling trick, which doubles the capacity of the array every time the array becomes full. Our analysis shows that starting with an array of capacity 1 with no data items initially, appending n data items ends up needing at most 2n copying steps. Homework 2 2 Data Struct. This problem involves a more fancy array growing scheme. To describe this new approach, recall the Fibonacci sequence from Discrete Math, which is given by Fn+2Fn+1+Fn for n ≥ 0, with F₁ = F2 = 1. In our new scheme, the capacity of the underlying array will strictly follow the Fibonacci sequence. Initially, the capacity is F2 = 1. When full, we grow the capacity to F3 = 2. When full again, we grow the capacity to F4 = 3... then to F5 = 5, then to F6 = 8, and so on. Amazingly this turns out to work quite well! You'll prove a few facts about Fibonacci numbers and apply them to analyze the total copying steps. Subtask I Using mathematical induction, prove that for n ≥ 1, 1+F+F2+... Fn = Fn+2 You're expected to write a solid, rigorous proof based on the definition of Fibonacci numbers (above). Subtask II Prove, e.g., using direct proof that for n ≥ 1, Fn (1+) 53 k=1 Subtask III Suppose we start with no data items in our ArrayList. If we use the Fibonacci growth scheme and add in n data items, give a detailed analysis of the total number of copy steps (like we did in class) of this scheme. State your argument carefully. To simplify matters, you may wish to assume that n = F+ + 1 for some integer r≥2.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
For this task, save your work in hw2.pdf
In class, our ArrayList implementation uses the array doubling trick, which doubles the capacity of
the array every time the array becomes full. Our analysis shows that starting with an array of capacity 1
with no data items initially, appending n data items ends up needing at most 2n copying steps.
Homework 2
2
Data Struct.
This problem involves a more fancy array growing scheme. To describe this new approach, recall
the Fibonacci sequence from Discrete Math, which is given by
Fn+2Fn+1+Fn
for n ≥ 0,
with F₁ = F2 = 1. In our new scheme, the capacity of the underlying array will strictly follow the Fibonacci
sequence. Initially, the capacity is F2 = 1. When full, we grow the capacity to F3 = 2. When full again, we
grow the capacity to F4 = 3... then to F5 = 5, then to F6 = 8, and so on.
Amazingly this turns out to work quite well! You'll prove a few facts about Fibonacci numbers and
apply them to analyze the total copying steps.
Subtask I Using mathematical induction, prove that for n ≥ 1,
1+F+F2+... Fn = Fn+2
You're expected to write a solid, rigorous proof based on the definition of Fibonacci numbers
(above).
Subtask II Prove, e.g., using direct proof that for n ≥ 1,
Fn
(1+) 53
k=1
Subtask III Suppose we start with no data items in our ArrayList. If we use the Fibonacci growth scheme and
add in n data items, give a detailed analysis of the total number of copy steps (like we did in class)
of this scheme. State your argument carefully. To simplify matters, you may wish to assume that
n = F+ + 1 for some integer r≥2.
Transcribed Image Text:For this task, save your work in hw2.pdf In class, our ArrayList implementation uses the array doubling trick, which doubles the capacity of the array every time the array becomes full. Our analysis shows that starting with an array of capacity 1 with no data items initially, appending n data items ends up needing at most 2n copying steps. Homework 2 2 Data Struct. This problem involves a more fancy array growing scheme. To describe this new approach, recall the Fibonacci sequence from Discrete Math, which is given by Fn+2Fn+1+Fn for n ≥ 0, with F₁ = F2 = 1. In our new scheme, the capacity of the underlying array will strictly follow the Fibonacci sequence. Initially, the capacity is F2 = 1. When full, we grow the capacity to F3 = 2. When full again, we grow the capacity to F4 = 3... then to F5 = 5, then to F6 = 8, and so on. Amazingly this turns out to work quite well! You'll prove a few facts about Fibonacci numbers and apply them to analyze the total copying steps. Subtask I Using mathematical induction, prove that for n ≥ 1, 1+F+F2+... Fn = Fn+2 You're expected to write a solid, rigorous proof based on the definition of Fibonacci numbers (above). Subtask II Prove, e.g., using direct proof that for n ≥ 1, Fn (1+) 53 k=1 Subtask III Suppose we start with no data items in our ArrayList. If we use the Fibonacci growth scheme and add in n data items, give a detailed analysis of the total number of copy steps (like we did in class) of this scheme. State your argument carefully. To simplify matters, you may wish to assume that n = F+ + 1 for some integer r≥2.
Expert Solution
steps

Step by step

Solved in 2 steps

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