Monday, January 26, 2015

Changes 1/26/15 Heaps

Mr. Elkner gave me a python implementation of a heap to type up and a couple of questions to go along with it.  It was a good exercise because it showed how a regular array can be used to represent values in a binary tree.  EIMACS had talked a little bit about that but getting to actually work with the code was really helpful.  I think I have a good understanding of how the heap is actually built.  The method #heap_down, which swaps elements to ensure they obey the contract of a max_heap was a bit hard to understand at first, but I understand it much better after going through the code line by line to try to understand it.

1 comment:

  1. We will return to heaps at the end of February. For now, we need to strike while the iron is hot and jump into FX OS while we have access to and excitement from the development community.

    ReplyDelete