{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fagw.hatenablog.jp%2Fentry%2F20090428%2F1240993676\" title=\" kd-tree Visualization(3) - agw\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","version":"1.0","categories":["Algorithm"],"url":"https://agw.hatenablog.jp/entry/20090428/1240993676","published":"2009-04-28 17:27:56","image_url":"https://cdn-ak.f.st-hatena.com/images/fotolife/a/agw/20090428/20090428002207.png","title":" kd-tree Visualization(3)","author_name":"agw","blog_url":"https://agw.hatenablog.jp/","author_url":"https://blog.hatena.ne.jp/agw/","description":"\u3055\u3066\u3001\u5148\u65e5\u306e\u30a8\u30f3\u30c8\u30ea\u306b\u3066\u3001\u30e1\u30c7\u30a3\u30a2\u30f3\u3092\u52a0\u5473\u3057\u305f2d\u6728\u306e\u69cb\u7bc9\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002\u30b3\u30fc\u30c9\u306e\u898b\u901a\u3057\u3092\u7c21\u6f54\u306b\u3059\u308b\u76ee\u7684\u3082\u3042\u308a\u3001\u30e1\u30c7\u30a3\u30a2\u30f3\u306e\u9078\u629e\u306b\u306fsort()\u3092\u7528\u3044\u307e\u3057\u305f\u3002 #!/usr/bin/python -t from operator import itemgetter from random import seed, randint def build(points, d=1): pts = list(points) if not pts: return None h = len(pts) // 2 pts.sort(key=itemgetter(d)) d = (d + 1) % 2 retur\u2026","provider_url":"https://hatena.blog","height":"190","type":"rich","provider_name":"Hatena Blog","blog_title":"agw\u306e\u65e5\u8a18"}