| | |
recursion sierpinskys triangle - HELP!!
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2008
Posts: 13
Reputation:
Solved Threads: 0
strange, i see my last little post in the wrong order...
ok, lets look at it close: for 1 ir is of course only 1 triangle, because the recurive calls are not executed, for 2 its 3 + 1, for 3 it's 3*3 + 1, for 4 its ((4*3)+1)*3 +1hm.... i don't se it, maybe too tired...
i think O(n^3) or O(3^n), but 3^n would even grow faster I think, maybe It's a bit smaller than than n^3, maybe still something logarithmic, because the line are split in hals... but i can only gues right now...
ok, lets look at it close: for 1 ir is of course only 1 triangle, because the recurive calls are not executed, for 2 its 3 + 1, for 3 it's 3*3 + 1, for 4 its ((4*3)+1)*3 +1hm.... i don't se it, maybe too tired...
i think O(n^3) or O(3^n), but 3^n would even grow faster I think, maybe It's a bit smaller than than n^3, maybe still something logarithmic, because the line are split in hals... but i can only gues right now...
•
•
Join Date: Nov 2008
Posts: 332
Reputation:
Solved Threads: 54
a = new Point(0, 443);
b = new Point(512, 443);
c = new Point(256, 0);
tryAngle = new TriangleQuu(a, b, c); tryAngle = new TriangleQuu(c, a, b); to see later
Last edited by quuba; Dec 8th, 2008 at 10:08 pm. Reason: sleep time
•
•
•
•
i think it would be much nicer to call the method with a value, which relates to what happens in recursion,
•
•
•
•
and please don't misunderstand, but i would recommend you to look at the previous posts, and go into the topic, before y<ou post before
In this case, the variant with 1 condition is the best
So what if you can see the darkest side of me?
No one would ever change this animal I have become
Help me believe it's not the real me
Somebody help me tame this animal
No one would ever change this animal I have become
Help me believe it's not the real me
Somebody help me tame this animal
![]() |
Other Threads in the Java Forum
- Previous Thread: Help on arrays!! Progress Made!!
- Next Thread: Loan repayment calculator
| Thread Tools | Search this Thread |
Tag cloud for Java
addressbook android api apple applet application arguments array arrays automation binary bluetooth button calculator chat class classes client code columns component converter database draw eclipse error errors event exception file fractal ftp game givemetehcodez graphics gridlayout gui helpwithhomework html ide image inetaddress input integer j2me japplet java javaprojects jme jmf jni jpanel julia link linux list loop map method methods midlethttpconnection mobile netbeans newbie number objects openjavafx oracle php print problem program programming project projects recursion rim scanner screen server set signing size smart sms socket sort sql storm string support swing test threads time tree unlimited variablebinding webservices windows





