This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
def __init__(self,value): | |
self.left = Leaf() | |
self.right = Leaf() | |
self.value = value | |
self.maxima = value.high | |
def search(tree,interval): | |
if interval.low > tree.maxima: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION public.hs_2json(hs hstore) RETURNS text AS $$ | |
DECLARE | |
rv text; | |
r record; | |
BEGIN | |
rv:=''; | |
for r in (select key, val from each(hs) as h(key, val)) loop | |
if rv<>'' then | |
rv:=rv||','; | |
end if; |