{"title":"\u901f\u3044nub\u304c\u6b32\u3057\u3044\uff0e\uff08Haskell)","url":"https://jeneshicc.hatenadiary.org/entry/20090908/1252413541","published":"2009-09-08 21:39:01","height":"190","author_url":"https://blog.hatena.ne.jp/jeneshicc/","provider_name":"Hatena Blog","width":"100%","provider_url":"https://hatena.blog","author_name":"jeneshicc","description":"The Haskell 98 Library Report: List Utilities \u306b\u3088\u308b\u3068\uff0c nub :: (Eq a) => [a] -> [a] nub [] = [] nub (x:xs) = x : nub (filter (\\y -> not (x == y)) xs) \u306a\u306e\u3067\uff0c\u5b9f\u306fnub\u306fO(n^2). Eq \u3060\u3051\uff0c\u3060\u304b\u3089\u4ed5\u65b9\u306a\u3044\u306e\u304b\u3082\u3057\u308c\u306a\u3044\u304c\uff0e \u3057\u304b\u3057\uff0c nub :: (Ord a) => [a] -> [a] \u306b\u3059\u308c\u3070\uff0cO(n log n) \u306b\u3067\u304d\u308b\uff0eSet\u306emember, insert\u306f log n \u3067\u3042\u308b\u3053\u3068\u3092\u5229\u7528\u3059\u308b\uff0e import Data.Set (emp\u2026","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fjeneshicc.hatenadiary.org%2Fentry%2F20090908%2F1252413541\" title=\"\u901f\u3044nub\u304c\u6b32\u3057\u3044\uff0e\uff08Haskell) - \u843d\u66f8\u304d\u3001\u6642\u3005\u843d\u5b66\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://jeneshicc.hatenadiary.org/","version":"1.0","image_url":null,"blog_title":"\u843d\u66f8\u304d\u3001\u6642\u3005\u843d\u5b66","type":"rich","categories":["Haskell","\u65e5\u8a18"]}