
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
c++ Language
I need help with question #6 part c please.
I asked this question 3 times but i keep getting programs im not able to run. Things with "DP" etc... Please make it as simple as possible for me thank you so so much.
I did a and b already, i just need with c using dynamic

Transcribed Image Text:6) There are other recursive functions such as the Lucas Sequence, how can you apply what you have
learned to it?
a) Iteratively computation
b) Recursive computation
c) Recursive computation with dynamic programming.
a)
int lucas (int num)
int a = 2, b = 1, Saį;
if (num ==0)
return a;
for (i =2; i <=num; i++)
{
= atki
a = b;
C
b = c;
}
return b;
b)
int Lucassequence ( int num) {
if (num == 0)
return 2;
if (num == 1)
return 1;
return Lugasfeauence (num
- 1)
+ Lucasseguence (num - 2);
С.
![Study the Fibonacci number sequence in the following forms: (1) iterative (sequential), (2) recursive, (3)
and closed form solution.
1) Examine the theoretical measure of time complexity of each.
a) Using theory compare the number of operations and time taken to compute Fibonacci numbers
recursively versus that needed to compute them iteratively.
b) How many prime Fibonacci numbers are there, and how many can you find?
c) Find the smallest Fibonacci number > 1,000,000
d) Find the smallest Fibonacci number > 1,000,000,000
2) Implement each Fibonacci form (1, 2, and 3 see above) in the C++ language (C++ 17).
Write four functions:
a) An iterative function that accepts a non-negative integer n and returns the nth Fibonacci number.
b) A recursive function that inputs a non-negative integer n and returns the nth Fibonacci number.
c) An improved recursive function that employs dynamic programming to improve the efficiency.
d) The closed form of the Fibonacci sequence (be sure to reference the golden ratio)
3) Using your software, compute a set of Fibonacci numbers employing the four techniques (c.f. 2, above);
for example, use n: {10, 15, 40, 41, 42, 50, 60, 100, 500, 600}.
a) Measure the time for each computation-send the results to a file.
* Recommend using the Chrono library from C++
b) Make certain you have "sufficient" data for convincing results.
4) Import your data (from 3) to excel for easy graphing
5) Compare the theoretical curves of Big-O with the empirical results.
a) Try running on machines with [significantly] different speeds.
b) Compare methods to answer the find an answer to question 1.c, above.
6) There are other recursive functions such as the Lucas Sequence, how can you apply what you have
learned to it?
a) Iteratively computation
b) Recursive computation
c) Recursive computation with dynamic programming.](https://content.bartleby.com/qna-images/question/e8f98c03-2dea-45fe-9e7d-c001811b98bd/40ef5db5-317b-43fe-9b51-65033fc139b7/5dvuten_thumbnail.png)
Transcribed Image Text:Study the Fibonacci number sequence in the following forms: (1) iterative (sequential), (2) recursive, (3)
and closed form solution.
1) Examine the theoretical measure of time complexity of each.
a) Using theory compare the number of operations and time taken to compute Fibonacci numbers
recursively versus that needed to compute them iteratively.
b) How many prime Fibonacci numbers are there, and how many can you find?
c) Find the smallest Fibonacci number > 1,000,000
d) Find the smallest Fibonacci number > 1,000,000,000
2) Implement each Fibonacci form (1, 2, and 3 see above) in the C++ language (C++ 17).
Write four functions:
a) An iterative function that accepts a non-negative integer n and returns the nth Fibonacci number.
b) A recursive function that inputs a non-negative integer n and returns the nth Fibonacci number.
c) An improved recursive function that employs dynamic programming to improve the efficiency.
d) The closed form of the Fibonacci sequence (be sure to reference the golden ratio)
3) Using your software, compute a set of Fibonacci numbers employing the four techniques (c.f. 2, above);
for example, use n: {10, 15, 40, 41, 42, 50, 60, 100, 500, 600}.
a) Measure the time for each computation-send the results to a file.
* Recommend using the Chrono library from C++
b) Make certain you have "sufficient" data for convincing results.
4) Import your data (from 3) to excel for easy graphing
5) Compare the theoretical curves of Big-O with the empirical results.
a) Try running on machines with [significantly] different speeds.
b) Compare methods to answer the find an answer to question 1.c, above.
6) There are other recursive functions such as the Lucas Sequence, how can you apply what you have
learned to it?
a) Iteratively computation
b) Recursive computation
c) Recursive computation with dynamic programming.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Fundamentals of Programming in C Language, BASICS ONLY Write the C language statement or statements for each of the following English descriptions in the space provided below each description. Be sure to use proper syntax as needed. Multiply watts times seconds and put the answer in joules_of_energy. (Tip, start your statement with joules_of_energy =......)arrow_forwardc++ Language I need help with question #6 part c please. **WITHOUT "DP" please. I keep getting dp in the answers from you guys and it's very confusing and i can't use that please. Don't use "DP" please and thank you so much. I asked this question 3 times but i keep getting programs im not able to run. Please make it as simple as possible for me thank you so so much. I did a and b already, i just need with c using dynamic programming. Please and thanks!arrow_forwardTrying to update a C++ code I wrote earlier (perhaps around 30-60 lines of code) and make it compile and run showing how to use: Note: I am currently working on using class. I am not commited to the below code, just looking for a job example to help me understand the concepts better and how to clean up my own code to be more effiecent using the current items I am reading about. I would like to stay using the address example though. Please label code to help me understand as I break it down. a. abstract data type b. const c. class constructor #include <iostream>#include <string> using namespace std; class address // address structure type{public:string streetAddress;string city;string state;int zipcode; }; int main() { address guest; // class address named guest address home; // class adress named home and inputshome.streetAddress = "1234 Right Way Rd.";home.city = "Huntsville";home.state = "AL";home.zipcode = 35803; cout << "What is your address?…arrow_forward
- Please help, I need the code in C language I'm struggling.arrow_forwardHey thank you for your answer. I would like to know the main C++ modules that I need to know/understand to complete this program myself. i.e (Classes, structures, arrays, strings...) Please let me know the exact modules so I can study them as soon as possible. Thank you.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education