{"id":304322,"date":"2020-05-27T09:00:45","date_gmt":"2020-05-27T09:00:45","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304322"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304322","title":{"rendered":"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u044b\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435\u043c"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/edison\/blog\/504012\/\">\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0438\u0437 \u0418\u043d\u0434\u0438\u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 Zig-Zag, Zig-Zig \u0438 Zig, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 SplaySort:<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/post\/504012\/\"><\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"590\" src=\"https:\/\/habrastorage.org\/webt\/0j\/qa\/l0\/0jqal0merugvc0u93nolsk_l0i0.jpeg\"><\/div>\n<p><\/a><a name=\"habracut\"><\/a><br \/>  \u0412 \u044d\u0442\u043e\u043c \u0441\u0435\u0437\u043e\u043d\u0435 \u043c\u044b \u0438\u0437\u0443\u0447\u0430\u0435\u043c <a href=\"https:\/\/habr.com\/ru\/company\/edison\/blog\/495420\/\">\u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u0443\u0447\u0438 \u0438 \u043a\u0430\u043a \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438<\/a>. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u0441\u0435\u0439 \u0440\u0430\u0437 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0448\u0430\u0433 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043e\u0442 \u043c\u0430\u0433\u0438\u0441\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0435\u043c\u044b. \u0421\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044f\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u2014 splay tree \u2014 \u043a\u0443\u0447\u0435\u0439 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f. \u041d\u043e \u043e\u043d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0440\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043a \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043a\u0443\u0447\u0438 \u2014 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u043a\u0446\u0438\u044f \u043f\u0440\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u0434\u0435\u043a\u0430\u0440\u0442\u043e\u0432\u044b\u043c \u0434\u0435\u0440\u0435\u0432\u043e\u043c.<\/p>\n<h2>\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u043c \u0434\u0435\u0440\u0435\u0432\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u0430 :: Binary search tree sort<\/h2>\n<p>  Splay tree \u2014 \u044d\u0442\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u043e\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u043e\u0438\u0441\u043a\u0430. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043a\u0430\u043a \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u00ab\u043d\u0435\u0443\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u043e\u0433\u043e\u00bb \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0437\u043d\u0430\u0435\u0442\u0435, \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u043c \u0434\u0435\u0440\u0435\u0432\u0435 \u043b\u044e\u0431\u043e\u0439 \u043b\u0435\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043c\u043e\u043a \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c, \u043b\u044e\u0431\u043e\u0439 \u043f\u0440\u0430\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043c\u043e\u043a \u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 (\u0442.\u0435. \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u0435\u043d) \u0447\u0435\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c. <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" width=\"760\" height=\"511\" src=\"https:\/\/habrastorage.org\/webt\/2e\/ie\/2b\/2eie2b53zaztn8ixd0wgqf5hlqu.gif\"><\/div>\n<p>  \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u0430\u044f:<\/p>\n<ul>\n<li><b>\u042d\u0442\u0430\u043f 1. \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441\u0442\u0440\u043e\u0438\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u043e\u0438\u0441\u043a\u0430.<\/b> \u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043a\u043b\u0430\u0434\u0451\u043c \u0432 \u043a\u043e\u0440\u0435\u043d\u044c, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441 \u043a\u043e\u0440\u043d\u0435\u043c, \u0437\u0430\u0442\u0435\u043c, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u0434\u0432\u0438\u0436\u0435\u043c\u0441\u044f \u0432\u043d\u0438\u0437 \u043f\u043e \u043b\u0435\u0432\u044b\u043c \u0438\u043b\u0438 \u043f\u0440\u0430\u0432\u044b\u043c \u0432\u0435\u0442\u043a\u0430\u043c (\u0438 \u043f\u043e \u043f\u0443\u0442\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441 \u0438\u043c\u0435\u044e\u0449\u0438\u043c\u0438\u0441\u044f \u0443\u0437\u043b\u0430\u043c\u0438 \u0434\u0435\u0440\u0435\u0432\u0430). \u0412 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0432\u0435\u0442\u043a\u0438 \u0438 \u0441\u0430\u043c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0443\u0437\u043b\u043e\u043c.<\/li>\n<li><b>\u042d\u0442\u0430\u043f 2. \u041e\u0431\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043e\u0442 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0430 \u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443.<\/b> \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u0433\u0430\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 (\u043b\u0435\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043c\u043e\u043a \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c, \u0430 \u043f\u0440\u0430\u0432\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u0435\u043d \u0447\u0435\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043e\u0431\u043e\u0439\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u043e\u0442 \u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043a \u0431\u043e\u043b\u044c\u0448\u0438\u043c. \u0427\u0442\u043e \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432\u044b\u0434\u0430\u0451\u0442 \u0443\u0437\u043b\u044b \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0435\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435.<\/li>\n<\/ul>\n<p>  \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u043d\u043e\u0441\u043d\u043e \u0432 \u043f\u043b\u0430\u043d\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u2014 \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u043d\u043e\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <nobr>O(log <b>n<\/b>)<\/nobr>, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u0301\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u0442\u0430\u043f\u0430 \u2014 <nobr>O(<b>n<\/b> log <b>n<\/b>)<\/nobr>.<\/p>\n<p>  \u0410 \u0432\u043e\u0442 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u0440\u0430\u0434\u0443\u0436\u043d\u043e. \u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u043e\u0431\u0445\u043e\u0434 \u0434\u0435\u0440\u0435\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0430\u0442\u044c \u0434\u043e\u043b\u0433\u0438\u043c \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435\u043c \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u0438\u0437\u0432\u0438\u043b\u0438\u0441\u0442\u043e\u043c\u0443 \u043b\u0430\u0431\u0438\u0440\u0438\u043d\u0442\u0443 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u0301\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0447\u0430\u0441\u0442\u043e \u0434\u0435\u0433\u0440\u0430\u0434\u0438\u0440\u0443\u0435\u0442 \u0434\u043e <nobr>O(<b>n<\/b><sup>2<\/sup>)<\/nobr>.<\/p>\n<h2>Splay tree<\/h2>\n<p>  \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432\u0441\u0435\u0433\u043e \u043a\u0430\u043a\u0438\u0445-\u0442\u043e 35-37 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0434\u0432\u0430 \u0443\u0447\u0451\u043d\u044b\u0445-\u0441\u0430\u0435\u043d\u0442\u0438\u0441\u0442\u0430 \u0420\u043e\u0431\u0435\u0440\u0442 \u0422\u0430\u0440\u044c\u044f\u043d \u0438 \u0414\u044d\u043d\u0438\u0435\u043b \u0421\u043b\u0438\u0442\u043e\u0440 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u044d\u0442\u0443 \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u041e\u043d\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u043f\u0440\u0438 \u043b\u044e\u0431\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445 (\u0432\u0441\u0442\u0430\u0432\u043a\u0430, \u043f\u043e\u0438\u0441\u043a, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435) \u0441 \u043b\u044e\u0431\u044b\u043c \u0443\u0437\u043b\u043e\u043c \u0434\u0435\u0440\u0435\u0432\u0430 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u0434\u0435\u0440\u0435\u0432\u0430, \u0434\u0435\u043b\u0430\u044f \u0443\u0437\u0435\u043b \u043a\u043e\u0440\u043d\u0435\u043c \u0432\u0441\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<p>  <a href=\"https:\/\/habrastorage.org\/webt\/7e\/xv\/4d\/7exv4d7sxnht0l55ggmh4bucif8.jpeg\"><\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"313\" src=\"https:\/\/habrastorage.org\/webt\/8s\/vj\/ac\/8svjacb-n4jgxpjbbaxjv-fh-h0.jpeg\"><\/div>\n<p><\/a><br \/>  <i>\u041d\u0430 \u043b\u0435\u0432\u043e\u043c \u0444\u043e\u0442\u043e \u0420\u043e\u0431\u0435\u0440\u0442 \u0422\u0430\u0440\u044c\u044f\u043d (\u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u044f\u0434, \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u0440\u0430\u0432\u0430) \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0441 \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440\u043e\u043c \u041c\u0430\u0442\u0440\u0438\u0446\u044b \u0438 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u0435\u043b\u0435\u043c \u041f\u0430\u0441\u043a\u0430\u043b\u044f. \u041d\u0430 \u043f\u0440\u0430\u0432\u043e\u043c \u0444\u043e\u0442\u043e \u0414\u044d\u043d\u0438\u0435\u043b \u0421\u043b\u0438\u0442\u043e\u0440.<br \/>  \u041f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435 \u043f\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044e \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0444\u043e\u0440\u043c\u0430\u0442\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.<\/i><\/p>\n<p>  \u041d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u0438\u0436\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u00ab\u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0435\u0435\u0441\u044f \u0434\u0435\u0440\u0435\u0432\u043e\u00bb, \u0440\u0435\u0436\u0435 \u2014 \u00ab\u043a\u043e\u0441\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e\u00bb. \u0425\u043e\u0442\u044f \u0435\u0441\u043b\u0438 \u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0441\u043b\u043e\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0438, \u0442\u043e \u00ab\u0440\u0430\u0437\u0432\u0451\u0440\u043d\u0443\u0442\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e\u00bb (\u0430 \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435 \u2014 \u00ab\u0432\u044b\u0432\u0435\u0440\u043d\u0443\u0442\u043e\u0435\u00bb) \u0438 \u0437\u0432\u0443\u0447\u0438\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0438 \u0442\u043e\u0447\u043d\u0435\u0435 \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u041d\u043e \u0442\u043e \u0442\u0430\u043a\u043e\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c \u0443\u0437\u0435\u043b \u0432 \u043a\u043e\u0440\u0435\u043d\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u044b:<\/p>\n<h3>\u041f\u043e\u0432\u043e\u0440\u043e\u0442 Zig<\/h3>\n<p>  \u0415\u0441\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0440\u043d\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0442\u043e \u0432\u0441\u0451 \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. <\/p>\n<p>  \u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u044d\u0442\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a\u0430\u043a <b>X<\/b>, \u0430 \u0435\u0433\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f (\u044f\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u043a\u043e\u0440\u043d\u0435\u043c \u0434\u0435\u0440\u0435\u0432\u0430) \u2014 \u043a\u0430\u043a <b>P<\/b>.<br \/>  <b>A<\/b>, <b>B<\/b>, <b>C<\/b> \u2014 \u044d\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u044f. \u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c \u0432 \u044d\u0442\u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445 \u0443\u0437\u043b\u043e\u0432 \u043d\u0435\u0432\u0430\u0436\u043d\u043e, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0440\u043d\u0438 \u044d\u0442\u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u00ab\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c-\u043f\u043e\u0442\u043e\u043c\u043e\u043a\u00bb \u0441 <b>X<\/b> \u0438 <b>P<\/b>. \u0415\u0441\u043b\u0438 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0438\u0437 \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 (\u0442\u043e \u0435\u0441\u0442\u044c \u0435\u0441\u043b\u0438 \u0443 <b>X<\/b> \u0438 <b>P<\/b> \u043d\u0435\u0442 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432), \u0442\u043e \u044d\u0442\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"208\" src=\"https:\/\/habrastorage.org\/webt\/v3\/kg\/i0\/v3kgi01dbf_nluirdgnsaylmn6y.png\"><\/div>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c <b>X<\/b> \u043a\u043e\u0440\u043d\u0435\u043c \u0434\u0435\u0440\u0435\u0432\u0430, \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u00ab\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c-\u043f\u043e\u0442\u043e\u043c\u043e\u043a\u00bb \u043c\u0435\u0436\u0434\u0443 <b>X<\/b> \u0438 <b>P<\/b>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u043e <b>B<\/b> \u2014 \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0430\u0432\u044b\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u043c <b>X<\/b>, \u0441\u0442\u0430\u043b\u043e \u043b\u0435\u0432\u044b\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u043c <b>P<\/b> (\u0441 <b>A<\/b> \u0438 <b>C<\/b> \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e). \u0418 \u044d\u0442\u043e \u0432\u0441\u0451! \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u0430\u043a \u0431\u044b\u043b\u0430 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u043c \u0434\u0435\u0440\u0435\u0432\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u0430, \u0442\u0430\u043a \u0438\u043c \u0438 \u043e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u2014 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u00ab\u043b\u0435\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043c\u043e\u043a \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c, \u043f\u0440\u0430\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043c\u043e\u043a \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u0435\u043d, \u0447\u0435\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u00bb.<\/p>\n<p>  \u041d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 <b>X<\/b> \u044f\u0432\u043b\u044f\u043b\u0441\u044f \u043b\u0435\u0432\u044b\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u043c \u0434\u043b\u044f <b>P<\/b>. \u0415\u0441\u043b\u0438 \u0431\u044b <b>X<\/b> \u0431\u044b\u043b \u043f\u0440\u0430\u0432\u044b\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u043c, \u0442\u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0437\u0435\u0440\u043a\u0430\u043b\u0438\u0442\u044c: <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"208\" src=\"https:\/\/habrastorage.org\/webt\/em\/n6\/z9\/emn6z9kik0em1i03xpc5k7egrkq.png\"><\/div>\n<p>  \u0415\u0441\u043b\u0438 <b>X<\/b> \u0438\u043c\u0435\u0435\u0442 \u043d\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0430 \u0442\u0440\u0435\u0442\u0438\u0439, \u0442\u043e \u0432\u0441\u0451 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043d\u043e \u043d\u0435\u043d\u0430\u043c\u043d\u043e\u0433\u043e.<\/p>\n<p>  \u0415\u0441\u043b\u0438 <b>X<\/b> \u0438\u043c\u0435\u0435\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f <b>P<\/b>, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0435\u0441\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c <b>G<\/b>, \u0442\u043e \u0438\u043c\u0435\u0435\u043c \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438:<br \/>  1) \u0435\u0441\u043b\u0438 <b>X<\/b> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <i>\u0441 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u043c<\/i> \u0434\u043b\u044f <b>P<\/b>, \u0447\u0442\u043e \u0438 <b>P<\/b> \u0434\u043b\u044f <b>G<\/b>;<br \/>  2) \u0435\u0441\u043b\u0438 <b>X<\/b> \u0438 <b>P<\/b> \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f <i>\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 \u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c\u0438<\/i> \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439.<\/p>\n<h3>\u041f\u043e\u0432\u043e\u0440\u043e\u0442 ZigZig<\/h3>\n<p>  \u041f\u0443\u0441\u0442\u044c <b>X<\/b> \u2014 \u044d\u0442\u043e \u043b\u0435\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043c\u043e\u043a \u0434\u043b\u044f <b>P<\/b>, \u0430 <b>P<\/b> \u2014 \u043b\u0435\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043c\u043e\u043a \u0434\u043b\u044f <b>G<\/b> (\u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 <b>X<\/b> \u0438 <b>P<\/b> \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0430\u0432\u044b\u043c\u0438 \u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c\u0438 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e). <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"251\" src=\"https:\/\/habrastorage.org\/webt\/sh\/f3\/ev\/shf3evyiypukr9y08kvtiidhrvy.png\"><\/div>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 <b>X<\/b>, <b>P<\/b> \u0438 <b>G<\/b>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u044c\u044f <b>B<\/b> \u0438 <b>C<\/b>. \u0418 \u043d\u0430\u0448\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442.<\/p>\n<h3>\u041f\u043e\u0432\u043e\u0440\u043e\u0442 ZigZag<\/h3>\n<p>  \u0415\u0441\u043b\u0438 <b>X<\/b> \u043f\u0440\u0430\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043c\u043e\u043a, \u0430 <b>P<\/b> \u043b\u0435\u0432\u044b\u0439 (\u0438\u043b\u0438 <b>X<\/b> \u043b\u0435\u0432\u044b\u0439, \u0430 <b>P<\/b> \u043f\u0440\u0430\u0432\u044b\u0439, \u043d\u0435 \u0441\u0443\u0442\u044c), \u0442\u043e \u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u0432\u0430\u043c \u0443\u0436\u0435 \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u044d\u0442\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438:<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" width=\"642\" height=\"251\" src=\"https:\/\/habrastorage.org\/webt\/rz\/v1\/p2\/rzv1p25jwly-sz6lrv_o2alzlyc.png\"><\/div>\n<p>  \u0415\u0441\u043b\u0438 <b>X<\/b> \u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0435\u0449\u0451 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0442\u043e \u0434\u043b\u044f \u0435\u0433\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c ZigZig \u0438\u043b\u0438 ZigZag (\u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u2014 \u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437) \u043a \u0442\u043e\u043c\u0443 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044e \u0432\u0432\u0435\u0440\u0445 \u043f\u043e \u0432\u0435\u0442\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0442\u0440\u0435\u0442\u044c\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h2>\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u044b\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435\u043c :: Splay sort<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" align=\"right\" width=\"396\" height=\"590\" src=\"https:\/\/habrastorage.org\/webt\/ig\/xb\/3c\/igxb3c-v8_la--ej_irmsze7dai.gif\"><br clear=\"left\">  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0442\u0435 \u0436\u0435 \u043f\u0443\u043d\u043a\u0442\u044b \u0447\u0442\u043e \u0438 \u0432 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0435 \u0434\u0435\u0440\u0435\u0432\u043e\u043c \u2014 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c binary sort tree, \u0437\u0430\u0442\u0435\u043c \u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0435\u0433\u043e. \u041d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0434\u0435\u0440\u0435\u0432\u043e \u043d\u043e\u0432\u044b\u0439 \u0443\u0437\u0435\u043b \u2014 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u0437\u0438\u0433\u0438 \u0438 \u0437\u0430\u0433\u0438, \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u043a\u043e\u0440\u043d\u0435\u043c.<\/p>\n<p>  \u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0430 \u044d\u0442\u043e \u043d\u0435 \u0434\u0430\u0451\u0442, \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0443\u0437\u043b\u0430 (\u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0438\u0433\u0437\u0430\u0433\u043e\u0432\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u0440\u043d\u0435\u043c) \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <nobr>O(log <b>n<\/b>)<\/nobr> \u2014 \u0438 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u044d\u0442\u0430\u043f\u0430 <nobr>O(<b>n<\/b> log <b>n<\/b>)<\/nobr>.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0441 \u0434\u0435\u0440\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u2014 \u043e\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u044f\u043c\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u0432\u0441\u0451 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0430\u043a\u043e\u043c \u0440\u0430\u0441\u043f\u0440\u044f\u043c\u043b\u0451\u043d\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u0418 \u044d\u0442\u043e \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u0430\u043f (\u043e\u0431\u0445\u043e\u0434 \u0434\u0435\u0440\u0435\u0432\u0430), \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0449\u0430\u044f\u0441\u044f \u0438\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u043b\u0435\u0441\u0435\u043d\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e O(<b>n<\/b>).<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u0431\u0449\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 (\u0445\u0443\u0434\u0448\u0430\u044f, \u0441\u0440\u0435\u0434\u043d\u044f\u044f, \u043b\u0443\u0447\u0448\u0430\u044f) \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f <nobr>O(<b>n<\/b> log <b>n<\/b>)<\/nobr>.<\/p>\n<p>  \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0435\u043c MergeSort, QuickSort \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 HeapSort, \u043d\u043e \u0437\u0430\u0442\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 binary search tree.<\/p>\n<p>  \u041c\u043e\u0440\u0430\u043b\u044c \u0441\u0435\u0439 \u0431\u0430\u0441\u043d\u0438 \u0442\u0430\u043a\u043e\u0432\u0430: \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u043c \u0434\u0435\u0440\u0435\u0432\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u2014 \u0440\u0430\u0431\u043e\u0442\u0430\u0439\u0442\u0435 \u0441 \u043d\u0438\u043c \u043a\u0430\u043a \u0441\u043e splay tree, \u0442.\u0435. \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 \u043b\u044e\u0431\u044b\u043c \u0443\u0437\u043b\u043e\u043c \u0434\u0435\u0440\u0435\u0432\u0430 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 \u0443\u0437\u0435\u043b \u043a\u043e\u0440\u043d\u0435\u043c. <\/p>\n<h2>\u041a\u043e\u0434 \u043d\u0430 C<\/h2>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043b\u0430\u0431\u043e\u043d\u0435\u0440\u0432\u043d\u044b\u043c \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/*  *------------------------------------------------------------  *  *      File..........: $RCSfile: splaysort.c,v $  *      Revision......: $Revision: 1.2 $  *      Author........: Gary Eddy (gary@cs.mu.OZ.AU)  *\t\t\tAlistair Moffat (alistair@cs.mu.OZ.AU)  *      Date..........: $Date: 1995\/09\/07 06:19:17 $  *  *\tDescription:  *\t\tSorts by repeated insertion into a splay tree.  *\t\tInsertions are done top down  *  *------------------------------------------------------------  *\/  #include\t&lt;stdio.h&gt; #include\t&lt;stdlib.h&gt; #include\t&lt;malloc.h&gt; #include\t&lt;alloca.h&gt;  char\t*sort_name = &quot;Splaysort&quot;; char\t*sort_version = &quot;$Revision: 1.2 $&quot;;  \/* ** Define DATAPTR for the 12 byte per record version of the program. ** Otherwise only 8 extra bytes per record are used and data ** references are done by indexing the data array. ** Different compiler\/architecture combinations can cause wild ** variation in the ratio of speeds between these variations. *\/  #define DATAPTR  #ifdef DATAPTR #define DATA(p) ((p)-&gt;data) #else #define DATA(p) (A+size*(p-T)) #endif  \/* ** With the fast copy option enabled a more intelligent copy is used ** depending on the size of the items being copied. ** This approach adopted from the nqsort program of Bentley and McIlroy, ** see Software Practice and Experience, v23, n11, November 1993, 1249-65. *\/  #define FASTCOPY  #ifdef FASTCOPY #define COPYCODE(TYPE, parmi, parmj, n) { \\         long i = (n) \/ sizeof (TYPE); \\         register TYPE *pi = (TYPE *) (parmi); \\         register TYPE *pj = (TYPE *) (parmj); \\         do { \\                 *pi++ = *pj++;                    \\         } while (--i &gt; 0);      \\ }  void copyfunc(char *d, char *s, int size, int copytype) {         if(copytype &lt;= 1)                 COPYCODE(long, d, s, size)         else                 COPYCODE(char, d, s, size) \treturn; }  #define COPY(d,s,size) \\         if (copytype == 0) { \\                 *(long *)(d) = *(long *)(s); \\         } else \\                 copyfunc(d, s, size, copytype) #else #define COPY(d,s,size)\tmemcpy(d,s,size) #endif  typedef struct  node_rec node;  struct\tnode_rec { \tnode\t*left, *rght; #ifdef DATAPTR \tchar\t*data; #endif };  \/*  *\tsort():  *\t\tThe entire sort code   *  *\tAccesses outside variables:\tnone  *  *\tReturn value...:\t\tnone  *\/  void sort(void *A, size_t n, size_t size, int (*cmp)(const void *, const void *)) { \tregister node *next, *curr, *prnt; \tchar \t*item; \tnode\t*l, *r, *ch; \tnode\troot, *T, *new, *end, *move; #ifndef DATAPTR \tchar\t*p; #endif  \/* ** Determine which copying method will be used. *\/ #ifdef FASTCOPY \tint\tcopytype=((char *)A - (char *)0) % sizeof(long) || \t\tsize % sizeof(long) ? 2 : size == sizeof(long) ? 0 : 1; #endif   \tif(n &lt; 2) \t\treturn; \tif((T = new = (node *) malloc(sizeof(*T)*n)) == NULL) { \t\tfprintf(stderr, &quot;Couldn't allocate space for structure\\n&quot;); \t} \t\/*  \t** Do the first insertion manually to avoid the empty tree \t** case in the main loop. \t*\/ \tcurr = new++; \titem = A; \tcurr-&gt;left = curr-&gt;rght = NULL; #ifdef DATAPTR \tcurr-&gt;data = item; #endif \titem += size; \tend = T+n; \t\/* \t** For each item move down the tree dividing it into \t** two subtrees, one containing items less than the new \t** element and the other those which are greater. \t** The pointers l and r refer to the greatest element in the \t** smaller subtree and the smallest element in the large \t** subtree respectively. During the splitting of the tree \t** l and r retain children that may be incorrect in the final \t** tree but these false links are cut at the end of the \t** insertion. \t*\/  \tfor( ; new&lt;end; ) { \t\tl = r = &root; \t\twhile(curr != NULL) { \t\t\tif(cmp(item, DATA(curr)) &lt; 0) { \t\t\t\t\/* Left root case *\/ \t\t\t\tif((ch = curr-&gt;left) == NULL) { \t\t\t\t\tr = r-&gt;left = curr; \t\t\t\t\tbreak; \t\t\t\t} \t\t\t\t\/* Left zig-zig *\/ \t\t\t\telse if(cmp(item, DATA(ch)) &lt; 0) { \t\t\t\t\tcurr-&gt;left = ch-&gt;rght; \t\t\t\t\tch-&gt;rght = curr; \t\t\t\t\tr = r-&gt;left = ch; \t\t\t\t\tcurr = ch-&gt;left; \t\t\t\t} \t\t\t\t\/* Left zig-zag *\/ \t\t\t\telse { \t\t\t\t\tr = r-&gt;left = curr; \t\t\t\t\tl = l-&gt;rght = ch; \t\t\t\t\tcurr = ch-&gt;rght; \t\t\t\t} \t\t\t} \t\t\telse { \t\t\t\t\/* Right root case *\/ \t\t\t\tif((ch = curr-&gt;rght) == NULL) { \t\t\t\t\tl = l-&gt;rght = curr; \t\t\t\t\tbreak; \t\t\t\t} \t\t\t\t\/* Right zig-zag *\/ \t\t\t\telse if (cmp(item, DATA(ch)) &lt; 0) { \t\t\t\t\tl = l-&gt;rght = curr; \t\t\t\t\tr = r-&gt;left = ch; \t\t\t\t\tcurr = ch-&gt;left; \t\t\t\t} \t\t\t\t\/* Right zig-zig *\/ \t\t\t\telse { \t\t\t\t\tcurr-&gt;rght = ch-&gt;left; \t\t\t\t\tch-&gt;left = curr; \t\t\t\t\tl = l-&gt;rght = ch; \t\t\t\t\tcurr = ch-&gt;rght; \t\t\t\t} \t\t\t} \t\t} \t\t\/* Cut false links *\/ \t\tr-&gt;left = l-&gt;rght = NULL; \t\tnew-&gt;rght = root.left; \t\tnew-&gt;left = root.rght; #ifdef DATAPTR \t\tnew-&gt;data = item; #endif \t\tcurr = new++; \t\titem += size; \t} \t\/* Now copy all of the data back into the input array. \t** Uses an iterative destructive inorder traversal. \t** Last item inserted is the current root. \t*\/ \tprnt = NULL; \tmove = T; \twhile (1) { \t\tif ((next = curr-&gt;left) != NULL) { \t\t\t\/* left subtree exists *\/ \t\t\tcurr-&gt;left = prnt; \t\t\tprnt = curr; \t\t\tcurr = next; \t\t} \t\telse { \t\t\tnext = curr-&gt;rght; \t\t\tcurr-&gt;rght = move++; \t\t\tif (next != NULL) { \t\t\t\t\/* and arrange for a visit *\/ \t\t\t\tif((curr = next-&gt;left) != NULL) { \t\t\t\t\tnext-&gt;left = prnt; \t\t\t\t\tprnt = next; \t\t\t\t\tcontinue; \t\t\t\t} \t\t\t\telse { \t\t\t\t\tcurr = next; \t\t\t\t\tcontinue; \t\t\t\t} \t\t\t} \t\t\t\/* no right subtree either, turn around*\/ \t\t\tif (prnt != NULL) { \t\t\t\tcurr = prnt; \t\t\t\tprnt = prnt-&gt;left; \t\t\t\tcurr-&gt;left = NULL; \t\t\t\tcontinue; \t\t\t} \t\t\t\/* nothing left to be done *\/ \t\t\tbreak; \t\t} \t} #ifndef DATAPTR \t\/* \t** Change the goes-to array in rght to a comes_from in left. \t** Note the kludge on pointers, where left points into the  \t** character array containing the elements. \t*\/ \tfor(next = T, p = A; next &lt; end; p += size, next++) \t\tnext-&gt;rght-&gt;left = (node *)p; \t\/* and use the `comes from' array to unscramble the permutation *\/ \titem = (char *)malloc(size);         for (next=T; next&lt;end; next++) {                 char *datacurr, *dataleftcurr, *final;                 if (next-&gt;left == NULL)                         continue;                 curr = next;                 final = datacurr = DATA(curr);                 COPY(item, datacurr, size);                 while ((char *)(curr-&gt;left) != final) {                         dataleftcurr = (char *)(curr-&gt;left);                         COPY(datacurr, dataleftcurr, size);                         prnt = curr;                         curr = T + (((char *)(curr-&gt;left)-A)\/size);                         prnt-&gt;left = NULL;                         datacurr = dataleftcurr;                 }                 COPY(datacurr, item, size);                 curr-&gt;left = NULL;         } #else \t\/* Change the goes-to array in rght to a comes_from in left *\/ \tfor(next = T; next &lt; end; next++) \t\tnext-&gt;rght-&gt;left = next; \t\/* and use the `comes from' array to unscramble the permutation *\/ \t\/* \t** This 12 byte version uses the presence of the data pointer \t** by making it the flag for already placed items. This means \t** that left pointers can point to nodes, eliminating the \t** calculation to find the next node. \t*\/ \titem = (char *)malloc(size); \tfor (next=T; next&lt;end; next++) { \t\tchar *datacurr, *dataleftcurr, *final; \t\t\/* second condition guarantees at least one iteration \t\t** of while loop. \t\t*\/ \t\tif (DATA(next) == (char *) NULL || next-&gt;left == next) \t\t\tcontinue; \t\tfinal = datacurr = DATA(next); \t\tcurr = next-&gt;left; \t\tCOPY(item, datacurr, size); \t\twhile ((dataleftcurr = DATA(curr)) != final) { \t\t\tCOPY(datacurr, dataleftcurr, size); \t\t\tprnt = curr; \t\t\tcurr = curr-&gt;left; \t\t\tDATA(prnt) = (char *) NULL; \t\t\tdatacurr = dataleftcurr; \t\t} \t\tCOPY(datacurr, item, size); \t\tDATA(curr) = (char *) NULL; \t} #endif \tfree(item); \tfree(T); } \/* sort() *\/<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2>\u0422\u0440\u0435\u0439\u043b\u0435\u0440 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0435\u0440\u0438\u0438<\/h2>\n<p>  \u0410 \u043c\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u043a\u0443\u0447\u0430\u043c. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0432\u0435\u0449\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0442\u043e\u0439, \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f. \u042d\u0442\u043e \u0433\u0438\u0431\u0440\u0438\u0434 \u2014 \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u044f\u0432\u043b\u044f\u044e\u0449\u0430\u044f\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438 \u043a\u0443\u0447\u0435\u0439 \u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u043c \u0434\u0435\u0440\u0435\u0432\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u0430.<\/p>\n<p>  <img decoding=\"async\" height=\"498\" src=\"https:\/\/habrastorage.org\/webt\/gf\/96\/5w\/gf965wv0ih9ugz1ur98ywqe4oaq.gif\"><\/p>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>   <img loading=\"lazy\" decoding=\"async\" width=\"30\" height=\"30\" src=\"https:\/\/habrastorage.org\/webt\/3y\/wq\/mh\/3ywqmhuo7fv68jggkc416kbzuw4.png\"> <a href=\"https:\/\/en.wikipedia.org\/wiki\/Tree_sort\">Binary search tree<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Splaysort\">Splay tree<\/a><\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" width=\"30\" height=\"30\" src=\"https:\/\/habrastorage.org\/webt\/jw\/w-\/qu\/jww-queszzqnwmoa2hm-kfwu-9o.png\"> <a href=\"https:\/\/habr.com\/post\/210296\/\">Splay-\u0434\u0435\u0440\u0435\u0432\u044c\u044f<\/a><\/p>\n<h3>\u0421\u0442\u0430\u0442\u044c\u0438 \u0441\u0435\u0440\u0438\u0438:<\/h3>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/habr.com\/post\/414447\/\">Excel-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 AlgoLab.xlsm<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/post\/414653\/\">\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043e\u0431\u043c\u0435\u043d\u0430\u043c\u0438<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/post\/415935\/\">\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0430\u043c\u0438<\/a>\n<ul>\n<li><a href=\"https:\/\/habr.com\/post\/416653\/\">\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0440\u044f<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/post\/431094\/\">\u041f\u0430\u0441\u044c\u044f\u043d\u0441\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/post\/431694\/\">\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u00ab\u0425\u0430\u043d\u043e\u0439\u0441\u043a\u0430\u044f \u0431\u0430\u0448\u043d\u044f\u00bb<\/a><\/li>\n<li><b>\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u044b\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435\u043c<\/b><\/li>\n<li>\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u042e\u043d\u0433\u0430<\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/habr.com\/post\/422085\/\">\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0432\u044b\u0431\u043e\u0440\u043e\u043c<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/post\/431964\/\">\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043b\u0438\u044f\u043d\u0438\u0435\u043c<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/472466\/\">\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/483786\/\">\u0413\u0438\u0431\u0440\u0438\u0434\u043d\u044b\u0435 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438<\/a><\/li>\n<\/ul>\n<p>  \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 AlgoLab. \u0422\u0430\u043a \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 Excel-\u0444\u0430\u0439\u043b \u0441 \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u043c\u0438, \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u043e\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0441\u043a\u043e\u0440\u044f\u0447\u0438\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u043e\u0438\u0441\u043a\u0430.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/edison\/blog\/504012\/\"> https:\/\/habr.com\/ru\/company\/edison\/blog\/504012\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/edison\/blog\/504012\/\">\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0438\u0437 \u0418\u043d\u0434\u0438\u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 Zig-Zag, Zig-Zig \u0438 Zig, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 SplaySort:<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/post\/504012\/\"><\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"590\" src=\"https:\/\/habrastorage.org\/webt\/0j\/qa\/l0\/0jqal0merugvc0u93nolsk_l0i0.jpeg\"><\/div>\n<p><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-304322","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=304322"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304322\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}