IT/Software career thread: Invert binary trees for dollars.

Sheriff Cad

scientia potentia est
<Nazi Janitors>
34,456
83,967
I do think I have some kind of memory leak in there. It takes a bit too long computing for how simple it is.



Yeah I went over some arrays research when doing this before I realized I needed nested statements in order to fulfill his requirement. They look pretty simple to me because I am just looking at them as a spreadsheet starting from 0 both in length and width but I am sure I will screw my first one up.
You can't possibly have a memory leak when you're not dynamically allocating memory.
 

Khane

Got something right about marriage
<Rickshaw Potatoes>
22,032
16,076
Mmm... look at all all those studs. That's one handsome program.
 

Sheriff Cad

scientia potentia est
<Nazi Janitors>
34,456
83,967
Why you using a double for your loop control variable? lol
 

Noodleface

A Mod Real Quick
39,787
18,498
I wonder if your problem is you keep redefining average at the end of the loop

I dont remember how it works, but I wonder if it's doing something strange with memory there
 

Sheriff Cad

scientia potentia est
<Nazi Janitors>
34,456
83,967
I don't see anything weird in your code though a_skeleton_03. Maybe it's just your dev environment. It runs instantly on my rackspace pos host.
 

Khane

Got something right about marriage
<Rickshaw Potatoes>
22,032
16,076
Are you running your nested loop on a nested VM per chance?
 

Tenks

Bronze Knight of the Realm
14,163
607
While loops are pretty easy to write so there isn't a proper exit condition. Since most people are taught to write their for loops that are self-incrementing it is really hard to write an infinite with a for -- though technically possible of course.
 

Asshat wormie

2023 Asshat Award Winner
<Gold Donor>
16,820
30,971
We just brought double into our curriculum so instead of just using float or integer I said meh why not and put double in.

I know it won't have a decimal place.
Your Professor not taking points off for using a double as a loop counter is the best example of him being shitty. Try to avoid comparing doubles.