I'm trying to return a function that returns the maximum value in a heap (where the heap goes from min on top to max on the bottom). I understand how I could do something similar to this in BST. But I don't know how I would do this in a heap because I don't completely understand the organization for heaps. In a BST I would just keep going to the left until I get to the end. But if I keep going towards the bottom of a heap, there's a chance that the maximum value is on the other subtree. (Not sure if that made complete sense). Any help in how to approach this would be appreciated. Thanks in advance.
*edit
So I thought of a different way to approach this but it's not correct. Basically after coming to the conclusion that heaps are just a bunch of nested lists, I made a code that makes the heap into one list and uses another helper function that gets the max value. But how would I approach this by actually going through and looking at each individual node?