Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Task 5 bounds
#1
For task 5 at some point you will overflow the size of an integer.  How many levels are we expected to display?
Reply
#2
Scam overflows at 4,294,967,291 so we could print up to 32 levels
Reply
#3
The Scam interpreter is written in C, so whenever C overflows, so will Scam. But the actual point at which Scam overflows depends on the architecture (32 or 64 bit).
Reply
#4
What is a reasonable number of levels our program should be able to compute in however long you allow our program to run?

Mine starts to slow down at around 15 levels or so. 20 levels took quite a while.
Reply
#5
(09-01-2017, 04:17 PM)SSinischo Wrote: What is a reasonable number of levels our program should be able to compute in however long you allow our program to run?

Mine starts to slow down at around 15 levels or so.  20 levels took quite a while.

Well, I told you to implement a recursive process. The question is, are there any redundant computations (like fib)?
Reply
#6
(09-01-2017, 04:26 PM)lusth Wrote:
(09-01-2017, 04:17 PM)SSinischo Wrote: What is a reasonable number of levels our program should be able to compute in however long you allow our program to run?

Mine starts to slow down at around 15 levels or so.  20 levels took quite a while.

Well, I told you to implement a recursive process. The question is, are there any redundant computations (like fib)?

There are many redundant computations.  For each new level printed, the entire triangle above the level must be calculated again due to my recursive process.  Of course, this function would be a great candidate for memoization/dynamic programming... but we aren't allowed any lists or arrays.  Am I going about this the wrong way then?
Reply
#7
No, with redundant computations, behavior is likely exponential, so a slowing down even at small numbers of levels is to be expected.
Reply
#8
With recursion for this task, after 15 levels, is the display for the following levels expected to take some time to display due to recursion on pascal and computations?
Viserion was like the middle child, always forgotten about and dealt a bad hand generally, even in and after death. R.I.P. Viserion.... well.... sorta. Confused
Reply
#9
(09-07-2017, 12:26 AM)NicoleT Wrote: With recursion for this task, after 15 levels, is the display for the following levels expected to take some time to display due to recursion on pascal and computations?

yis. ur good.
UA ACM Vice President
ACM has bi-weekly meetings Tuesdays at 5:15pm
We're UA's best organization for CS majors (website)
Join us on Slack for all kinds of discussion channels (including one for CS403)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)