Thursday, November 3, 2016

A three line pit boss

OK, after deciding toencapsulate graph raversal in the igerator function, with a caller specified selector, the general for loop look like:

for Nodes in collection(selector,arg) : do_sometjin()

Starting with the pit boss, let just bubble sort on price:''

for Na i collection(Null,(start:Top) :
 for Nb in collection(Null,start:Na)
  if na.val() < Nb.val() : G.Swap(Na,Nb)

OK, this should be a broken bubble something that acts like a bubble sort, and would be if I did the work.  The Null selector function means visit every node.  That would be a bug, instead the pit boss would be better to use the singleton selector, select only items with block count 1.

What are singletons? Attempted cash transactions, an offer to trade digits X for fulfillment Y; with a response, Yes, No,o  Counter Offer.

But it is also a complete pit boss, if the traders all want the highest price first, the the tree. They get a linear array ordered by bid price.  But the pit boss could just as easily order by fulfillment ID.  Thay way aarddvark stocks would get a little attention.

B ut, standard algorithms implementsd for the pit boss, using pythin, will all be snippet code. Easily understood, simply because the pit boss has to be systematic, it doesn 't have the cycles to check every corner intersection on parameter bounds.  It has to rely on the normal self equulibriating queues to match its posted contract, keeping the pit balance.

No comments: