{"id":2424,"date":"2019-12-21T10:27:33","date_gmt":"2019-12-21T07:27:33","guid":{"rendered":"http:\/\/demensdeum.com\/blog\/?p=2424"},"modified":"2024-12-16T22:32:31","modified_gmt":"2024-12-16T19:32:31","slug":"lexicompare","status":"publish","type":"post","link":"https:\/\/demensdeum.com\/blog\/ja\/2019\/12\/21\/lexicompare\/","title":{"rendered":"\u8f9e\u66f8\u7de8\u96c6\u7684\u6bd4\u8f03\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0"},"content":{"rendered":"<p>\u8f9e\u66f8\u7de8\u96c6\u6587\u5b57\u5217\u6bd4\u8f03\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306f\u975e\u5e38\u306b\u7c21\u5358\u306b\u52d5\u4f5c\u3057\u307e\u3059\u3002\u6587\u5b57\u30b3\u30fc\u30c9\u306f\u30eb\u30fc\u30d7\u5185\u3067\u6bd4\u8f03\u3055\u308c\u3001\u6587\u5b57\u304c\u7b49\u3057\u304f\u306a\u3044\u5834\u5408\u306f\u7d50\u679c\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>C \u8a00\u8a9e\u306e\u4f8b\u306f\u6b21\u306e\u5834\u6240\u306b\u3042\u308a\u307e\u3059\u3002<br \/><a href=\"https:\/\/github.com\/gcc-mirror\/gcc\/blob\/master\/libiberty\/memcmp.c\">https:\/\/github.com\/gcc-mirror\/gcc\/blob\/master\/libiberty\/memcmp.c<\/a><\/p>\n<p>\u5358\u4e00\u306e\u9759\u7684\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u6587\u5b57\u3092\u6bd4\u8f03\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u3092\u8003\u616e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001Swift \u3067\u306f UTF-32 \u3067\u6587\u5b57\u3054\u3068\u306e\u6bd4\u8f03\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002 memcmp \u3092\u4f7f\u7528\u3057\u305f\u914d\u5217\u30bd\u30fc\u30c8 \u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u30b7\u30f3\u30b0\u30eb\u30d0\u30a4\u30c8\u6587\u5b57\u306b\u5bfe\u3057\u3066\u306f\u6b63\u78ba\u306b\u6a5f\u80fd\u3057\u307e\u3059\u304c\u3001\u305d\u306e\u4ed6\u306e\u5834\u5408 (\u53ef\u5909\u9577\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0)\u3001\u9806\u5e8f\u304c\u6b63\u3057\u304f\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u53ef\u5909\u9577\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306b\u57fa\u3065\u3044\u305f\u5b9f\u88c5\u306e\u53ef\u80fd\u6027\u306f\u6392\u9664\u3057\u307e\u305b\u3093\u304c\u3001\u304a\u305d\u3089\u304f\u6841\u9055\u3044\u306b\u8907\u96d1\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u6642\u9593\u8a08\u7b97\u91cf\u306f\u3001\u6700\u826f\u306e\u5834\u5408\u306f O(1)\u3001\u5e73\u5747\u304a\u3088\u3073\u6700\u60aa\u306e\u5834\u5408\u306f O(n) \u3067\u3059<\/p>\n<h3>\u30bd\u30fc\u30b9<\/h3>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/Lexicographic_order\" target=\"_blank\" rel=\"noopener\">https:\/\/ru.wikipedia.org\/wiki\/Lexicographic_order<\/a> <\/p>\n<h3>\u30bd\u30fc\u30b9<\/h3>\n<p><a href=\"https:\/\/gitlab.com\/demensdeum\/algorithms\/blob\/master\/lexiCompare\/lexiCompare.swift\" target=\"_blank\" rel=\"noopener\">https:\/\/gitlab.com\/demensdeum \/algorithms\/blob\/master\/lexiCompare\/lexiCompare.swift<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f9e\u66f8\u7de8\u96c6\u6587\u5b57\u5217\u6bd4\u8f03\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306f\u975e\u5e38\u306b\u7c21\u5358\u306b\u52d5\u4f5c\u3057\u307e\u3059\u3002\u6587\u5b57\u30b3\u30fc\u30c9\u306f\u30eb\u30fc\u30d7\u5185\u3067\u6bd4\u8f03\u3055\u308c\u3001\u6587\u5b57\u304c\u7b49\u3057\u304f\u306a\u3044\u5834\u5408\u306f\u7d50\u679c\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002 C \u8a00\u8a9e\u306e\u4f8b\u306f\u6b21\u306e\u5834\u6240\u306b\u3042\u308a\u307e\u3059\u3002https:\/\/github.com\/gcc-mirror\/gcc\/blob\/master\/libiberty\/memcmp.c \u5358\u4e00\u306e\u9759\u7684\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u6587\u5b57\u3092\u6bd4\u8f03\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u3092\u8003\u616e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001Swift \u3067\u306f UTF-32 \u3067\u6587\u5b57\u3054\u3068\u306e\u6bd4\u8f03\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002 memcmp \u3092\u4f7f\u7528\u3057\u305f\u914d\u5217\u30bd\u30fc\u30c8 \u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u30b7\u30f3\u30b0\u30eb\u30d0\u30a4\u30c8\u6587\u5b57\u306b\u5bfe\u3057\u3066\u306f\u6b63\u78ba\u306b\u6a5f\u80fd\u3057\u307e\u3059\u304c\u3001\u305d\u306e\u4ed6\u306e\u5834\u5408 (\u53ef\u5909\u9577\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0)\u3001\u9806\u5e8f\u304c\u6b63\u3057\u304f\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u53ef\u5909\u9577\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306b\u57fa\u3065\u3044\u305f\u5b9f\u88c5\u306e\u53ef\u80fd\u6027\u306f\u6392\u9664\u3057\u307e\u305b\u3093\u304c\u3001\u304a\u305d\u3089\u304f\u6841\u9055\u3044\u306b\u8907\u96d1\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002 \u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u6642\u9593\u8a08\u7b97\u91cf\u306f\u3001\u6700\u826f\u306e\u5834\u5408\u306f O(1)\u3001\u5e73\u5747\u304a\u3088\u3073\u6700\u60aa\u306e\u5834\u5408\u306f O(n) \u3067\u3059 \u30bd\u30fc\u30b9 https:\/\/ru.wikipedia.org\/wiki\/Lexicographic_order \u30bd\u30fc\u30b9 https:\/\/gitlab.com\/demensdeum \/algorithms\/blob\/master\/lexiCompare\/lexiCompare.swift<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[61,52],"tags":[131,135],"class_list":["post-2424","post","type-post","status-publish","format-standard","hentry","category-techie","category-tutorials","tag-algorithms","tag-lexicompare","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"ja","enabled_languages":["en","ru","zh","de","fr","ja","pt","hi"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"ru":{"title":true,"content":true,"excerpt":false},"zh":{"title":true,"content":true,"excerpt":false},"de":{"title":true,"content":true,"excerpt":false},"fr":{"title":true,"content":true,"excerpt":false},"ja":{"title":true,"content":true,"excerpt":false},"pt":{"title":true,"content":true,"excerpt":false},"hi":{"title":false,"content":false,"excerpt":false}}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/2424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/comments?post=2424"}],"version-history":[{"count":13,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/2424\/revisions"}],"predecessor-version":[{"id":3929,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/2424\/revisions\/3929"}],"wp:attachment":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/media?parent=2424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/categories?post=2424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/tags?post=2424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}