Skip to main content

Timeline for Min triangle path - bottom-up

Current License: CC BY-SA 3.0

16 events
when toggle format what by license comment
Oct 19, 2014 at 19:37 history edited toto2 CC BY-SA 3.0
Made Triangle a type alias. Simplified foldLeft start-up.
Oct 19, 2014 at 18:48 history edited Simon Forsberg CC BY-SA 3.0
formatting, made some things clearer
Oct 19, 2014 at 16:45 comment added Simon Forsberg Let us continue this discussion in chat.
Oct 19, 2014 at 16:44 comment added toto2 In Scala, Row is just a "type alias" which makes the code a bit clearer.
Oct 19, 2014 at 16:44 comment added Simon Forsberg unfortunately your Scala code is at the moment not very useful for me either as I don't understand much of it. Although it has given me one more reason to learn Scala.
Oct 19, 2014 at 16:44 comment added toto2 Yes, just Solution. I think it can make the recursive solution a lot cleaner. The recursive function takes in the current row and the List[Solution] for the rows below and returns a new List[Solution].
Oct 19, 2014 at 16:42 comment added toto2 It is not very useful at the moment to post Scala code on codereview since there are so few Scala programmers (at least on this site). I did get one useful review at some point however.
Oct 19, 2014 at 16:41 comment added Simon Forsberg Sorry, from your answer I thought you said my code was recursive. I misunderstood. The fact that it can cause a Stack Overflow in Java is one reason for why I decided to not make it recursive. What are the types that you would add? Just Row and Solution? The Solution might be a good idea.
Oct 19, 2014 at 16:36 comment added toto2 You are not using recursion. What I meant is that your while-loop is equivalent to calling a recursive function. When I read your code I thought it would be cleaner as a recursive function, but that is very arguable. I did not add the section about recursion to say that I disagree with your answer, but just as a suggestion/discussion.
Oct 19, 2014 at 16:33 comment added Simon Forsberg Your Scala code might fit better in a new question, and a link to it from here, instead of as an answer to this question.
Oct 19, 2014 at 16:23 comment added Simon Forsberg From what I can see of my code, I am definitely not using recursion. Where did you get that from? I am using iteration. Your Scala code is not very useful to me at the moment as I have not yet learned Scala (I would like to though).
Oct 19, 2014 at 1:31 history edited toto2 CC BY-SA 3.0
added 18 characters in body
Oct 19, 2014 at 1:25 history undeleted toto2
Oct 19, 2014 at 1:25 history edited toto2 CC BY-SA 3.0
added 91 characters in body
Oct 19, 2014 at 1:22 history deleted toto2 via Vote
Oct 19, 2014 at 1:17 history answered toto2 CC BY-SA 3.0