{"id":338657,"date":"2022-09-23T03:00:13","date_gmt":"2022-09-23T03:00:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=338657"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=338657","title":{"rendered":"<span>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u0438\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0434\u0430\u0432\u043d\u043e \u0447\u0438\u0442\u0430\u044e \u0425\u0430\u0431\u0440 \u0438 \u0432\u0441\u0435 \u0445\u043e\u0442\u0435\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u043b \u0441 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438 \u043e \u0447\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c. \u041d\u043e \u0440\u0435\u0448\u0438\u043b \u0447\u0442\u043e \u0442\u044f\u043d\u0443\u0442\u044c \u043a\u043e\u0442\u0430 \u0437\u0430 \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e. \u041d\u0430\u0434\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0437\u044f\u0442\u044c \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0437\u043e\u0440 \u043e \u0447\u0435\u043c \u0442\u043e \u0447\u0442\u043e \u044f \u0437\u043d\u0430\u044e \u0438 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 37 \u0448\u0442\u0443\u043a. \u042f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438, \u043e\u0434\u043d\u0430 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432.<\/p>\n<h3>\u0421\u043f\u0438\u0441\u043e\u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432<\/h3>\n<ul>\n<li>\n<p>Bubble  <\/p>\n<\/li>\n<li>\n<p>Shaker  <\/p>\n<\/li>\n<li>\n<p>Insertion  <\/p>\n<\/li>\n<li>\n<p>Stooge  <\/p>\n<\/li>\n<li>\n<p>Pancake  <\/p>\n<\/li>\n<li>\n<p>Shell  <\/p>\n<\/li>\n<li>\n<p>Merge  <\/p>\n<\/li>\n<li>\n<p>Selection  <\/p>\n<\/li>\n<li>\n<p>Quick  <\/p>\n<\/li>\n<li>\n<p>Gnome  <\/p>\n<\/li>\n<li>\n<p>Tree  <\/p>\n<\/li>\n<li>\n<p>Comb  <\/p>\n<\/li>\n<li>\n<p>BasicCounting  <\/p>\n<\/li>\n<li>\n<p>CombinedBubble  <\/p>\n<\/li>\n<li>\n<p>Heapify  <\/p>\n<\/li>\n<li>\n<p>Cocktail  <\/p>\n<\/li>\n<li>\n<p>OddEven  <\/p>\n<\/li>\n<li>\n<p>Tim  <\/p>\n<\/li>\n<li>\n<p>Counting  <\/p>\n<\/li>\n<li>\n<p>Radix  <\/p>\n<\/li>\n<li>\n<p>Bucket  <\/p>\n<\/li>\n<li>\n<p>BinaryInsertion  <\/p>\n<\/li>\n<li>\n<p>Bogo  <\/p>\n<\/li>\n<li>\n<p>Cycle<\/p>\n<\/li>\n<li>\n<p>Exchange  <\/p>\n<\/li>\n<li>\n<p>Heap  <\/p>\n<\/li>\n<li>\n<p>MSDRadix  <\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043e\u043a.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td rowspan=\"2\">\n<p align=\"left\"><strong>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<td colspan=\"3\" data-colwidth=\"0,0,131\" width=\"0\">\n<p align=\"left\"><strong>\u0412\u0440\u0435\u043c\u044f<\/strong><\/p>\n<\/td>\n<td rowspan=\"2\">\n<p align=\"left\"><strong>\u041f\u0430\u043c\u044f\u0442\u044c<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041b\u0443\u0447\u0448\u0435\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0440\u0435\u0434\u043d\u0435\u0435<\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\u0425\u0443\u0434\u0448\u0435\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Bubble  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/247\/58c\/de0\/24758cde05ea4c89494467a39fa2012e.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b37\/f8e\/7aa\/b37f8e7aaef25c7b47f88bbe7d045612.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b9d\/2c6\/e8f\/b9d2c6e8fd1be9e361a7cae9189406cb.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6e4\/897\/b88\/6e4897b880f1e25a5dc2245706ea2548.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Shaker  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3de\/c16\/3ba\/3dec163bac4f3ffca4cafb327ef0d976.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6a4\/78e\/2ca\/6a478e2caff1b387cd92a438462399b8.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ec2\/9ed\/6d0\/ec29ed6d0de1728f7eb83d2d8f98d90f.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a84\/6f2\/2c6\/a846f22c685b4aa53dca24f70ed24acd.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Insertion  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/886\/751\/dd4\/886751dd46d781190e2de8f370ca931e.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d7b\/ca1\/c1a\/d7bca1c1af5ee590833cb88a9f62b626.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/527\/c4b\/718\/527c4b718bc403c8fd9a69821f986ac4.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f86\/af2\/e16\/f86af2e1618d1a0a3eb3752a1524f5ca.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Stooge  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(\\frac{a^{log 3}}{log 1.5})\" alt=\"O(\\frac{a^{log 3}}{log 1.5})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/56d\/587\/978\/56d587978c5ae309d589d4cca206490b.svg\" width=\"86\" height=\"50\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(\\frac{a^{log 3}}{log 1.5})\" alt=\"O(\\frac{a^{log 3}}{log 1.5})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/579\/e57\/7a1\/579e577a1e0e0143178d8c4cb9ca18c7.svg\" width=\"86\" height=\"50\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(\\frac{a^{log 3}}{log 1.5})\" alt=\"O(\\frac{a^{log 3}}{log 1.5})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/57e\/df7\/f0e\/57edf7f0ea74f53218f0ca0f870f2e43.svg\" width=\"86\" height=\"50\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bad\/c89\/35a\/badc8935ab6913607eebe50e188c9980.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Pancake  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f1d\/3ba\/ccd\/f1d3baccdcea3b3364515870c148942a.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/558\/e61\/746\/558e61746cc78ed35832472f79eb13af.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/655\/afc\/8fe\/655afc8fe20b2fe8599dc6fb832af060.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/55c\/1e7\/b71\/55c1e7b7167924824da8ced3351c3f4a.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Shell  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times log^{2}n)\" alt=\"O(n\\times log^{2}n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/63a\/25c\/97a\/63a25c97a4c9ea836fc219116ccae9d9.svg\" width=\"110\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0417\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u044b\u0431\u043e\u0440\u0430 \u0448\u0430\u0433\u0430  <\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/499\/fd7\/288\/499fd72882cc765290f672faac1b99a6.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5eb\/a76\/70c\/5eba7670c7963a901f06d2c03abbacad.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Merge  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8ba\/160\/0e0\/8ba1600e0c08b9232df9a137099bbaca.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/02f\/31b\/e78\/02f31be78cd63354e8ea37c6c1b97d15.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1de\/aa1\/e4e\/1deaa1e4e309e92b0355ce2bf7793d85.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a23\/063\/38d\/a2306338d1faea2eaecd0a5d83b0f3db.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Selection  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bd6\/245\/324\/bd62453245a3461091602a86b4cf083e.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4ce\/fcd\/85b\/4cefcd85bcc7dca03738465f559ca86a.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d85\/776\/115\/d857761155f6c2095ac1d07c44b1052f.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f71\/b2b\/e13\/f71b2be135546481bb215eea95f8cb96.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Quick  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/62a\/c60\/4a8\/62ac604a8461513134c02c14947c65ec.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/32e\/da7\/a86\/32eda7a86aa583ff654f486135d91960.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/eb0\/d2e\/40a\/eb0d2e40a514ef69621d39c51036b00b.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(logn)\" alt=\"O(logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2a6\/cef\/bdd\/2a6cefbdd9bb0c8dab30d59ad7352784.svg\" width=\"66\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Gnome  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/171\/eee\/1fe\/171eee1fe980f32b775219726269b5b5.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/590\/b54\/c4c\/590b54c4c05144dc31f65efaa758a509.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3b0\/7f0\/f55\/3b07f0f55926172f6c7b1dcddf78eab7.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fbd\/d68\/f3b\/fbdd68f3b48adcaae3b1675690207214.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Tree  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/33e\/793\/9c1\/33e7939c1594d4e64b5b0547b26673d8.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0a3\/998\/966\/0a39989662c738ce11afdf0adb4f5fb8.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/364\/c11\/8c6\/364c118c6b6439fe1025b498ad6fac5c.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7da\/213\/25c\/7da21325cb606e75b296a455129f49d1.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Comb  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c4e\/328\/c2e\/c4e328c2eb62b7fdfe45acc8d26df3fc.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(\\frac{n^2}{2^p})\" alt=\"O(\\frac{n^2}{2^p})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/828\/7fb\/799\/8287fb7992ee866017bbf4c1f5fdb82b.svg\" width=\"57\" height=\"46\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b02\/f79\/02d\/b02f7902dc6068a4e3c58cdf0f58b1e6.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2ce\/00b\/82e\/2ce00b82e6c6a8d8675cfa50a8b29a32.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">BasicCounting  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/521\/337\/1d2\/5213371d2c7db2b9139315e501ec7c06.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n+k)\" alt=\"O(n+k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c41\/4cb\/105\/c414cb105197b5066e4a2650344c0cc9.svg\" width=\"75\" height=\"22\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n+k)\" alt=\"O(n+k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0ce\/a7f\/1fc\/0cea7f1fc30a9aa9a29a643b2c84adf6.svg\" width=\"75\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n+k)\" alt=\"O(n+k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e8e\/f9d\/a6c\/e8ef9da6cbce6db801d7733681d7a7ca.svg\" width=\"75\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">CombinedBubble  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/876\/01e\/fa1\/87601efa1166c095a68e4680a64ab468.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/53b\/dce\/45b\/53bdce45b0b16960aefd22542df61d98.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c57\/e60\/47d\/c57e6047d24f897496463119e7ac0c94.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/148\/615\/c5f\/148615c5f152b1e98059022ef5e44946.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Heapify  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/84b\/3cd\/d4c\/84b3cdd4cccf7520d17bbf22c2805e97.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b43\/6b0\/818\/b436b0818775cb13346f0ccf0ca27262.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c65\/cf1\/531\/c65cf1531148425c98f1f9dcda77ac30.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/956\/a25\/822\/956a258224efee76bd2e424abd860483.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Cocktail  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5d1\/80c\/cee\/5d180cceed6494f1d9d0429fa9b36669.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1d9\/953\/a27\/1d9953a272e0626b6885ad189b1d66b5.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/da5\/230\/15b\/da523015b95350ea23e8eb5404975e93.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee5\/f97\/a33\/ee5f97a336f2df2a18b4a8455ee0fd3b.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">OddEven  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7e5\/f23\/5ee\/7e5f235ee2591ae7f81f96ddf71b3ef4.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a5e\/fb1\/3cb\/a5efb13cb2623a4b9755effa731ff7bf.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/674\/86e\/21c\/67486e21c85121dc5f3369182d2dd55c.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9d9\/c47\/870\/9d9c478700a9a6fa4bbae435b9ed1bbb.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Tim  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2c2\/0d2\/547\/2c20d25477f872fa92139257eae9b7fc.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/905\/ca9\/3fd\/905ca93fdb9511d05d73b3995f0fe6a1.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/87c\/25c\/b19\/87c25cb19b8dd4e9de079b8fc2f0fc1a.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fff\/008\/ab6\/fff008ab6dec64d4aa9d83dced84340c.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Counting  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n+k)\" alt=\"O(n+k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b6a\/5c2\/2b1\/b6a5c22b1c6115da77921413db865ca1.svg\" width=\"75\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n+k)\" alt=\"O(n+k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/899\/29b\/7fa\/89929b7fac3c97a67deccb2b5607a159.svg\" width=\"75\" height=\"22\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/580\/d20\/629\/580d20629e171b756b86fa31cee2748d.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n+k)\" alt=\"O(n+k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/244\/a1c\/356\/244a1c3560767912ea08bdbf03deddfd.svg\" width=\"75\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Radix  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times k)\" alt=\"O(n\\times k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/436\/4f8\/c94\/4364f8c944992fc5549725b4d0c0da23.svg\" width=\"75\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times k)\" alt=\"O(n\\times k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fe3\/4ed\/7bd\/fe34ed7bd0711cf92a2d0275a74fb166.svg\" width=\"75\" height=\"22\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4ba\/736\/f9e\/4ba736f9eb2721187a93f127dfd4131d.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n \u00d7 k)\" alt=\"O(n \u00d7 k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0e6\/e63\/85c\/0e6e6385c2ff90346a9874ce2225dda5.svg\" width=\"75\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Bucket  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e4c\/045\/d9e\/e4c045d9eb4c607b79f6f74216596d96.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times k)\" alt=\"O(n\\times k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/df6\/100\/fdf\/df6100fdf42eacbba14772cb55c21229.svg\" width=\"75\" height=\"22\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/396\/8f1\/e06\/3968f1e06fc296a6c301896411ab983b.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n \u00d7 k)\" alt=\"O(n \u00d7 k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/517\/004\/3f1\/5170043f18f39e82180ed04f269536be.svg\" width=\"75\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">BinaryInsertion  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fb4\/472\/bf0\/fb4472bf0f35f0a5d9d02d4718a23a9c.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/91a\/6db\/34f\/91a6db34f4152fe4e2d09a2a9c9fab6c.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/122\/2f7\/a2d\/1222f7a2df155e64dba83d166edce3f1.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a97\/5fe\/acd\/a975feacd48978010a3a878e03082c68.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Bogo  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/635\/788\/2a0\/6357882a09c6d4aaec1013f8d7808153.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times n!)\" alt=\"O(n\\times n!)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f7b\/350\/ab4\/f7b350ab4110ce9c50e0d99046d86c0e.svg\" width=\"82\" height=\"22\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times n!)\" alt=\"O(n\\times n!)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/17d\/303\/7f6\/17d3037f61845d795c17fa20768af72a.svg\" width=\"82\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5a3\/fae\/afa\/5a3faeafa6e3caf1ca466e2ee5d0e315.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Cycle  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(-)\" alt=\"O(-)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4d6\/f06\/55d\/4d6f0655d9200b88c8100458f35be61e.svg\" width=\"45\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e32\/e6f\/bf8\/e32e6fbf829296f90e06379501e81170.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/324\/65f\/574\/32465f5748ff6006b2bf2f846582671b.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2d6\/b4a\/f61\/2d6b4af61c2840357bdb17ed9f79ccf8.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Exchange  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/76c\/14d\/552\/76c14d552169046514e96ee5e1b60f42.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6e2\/740\/ba6\/6e2740ba62c34a154003561a53456f15.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n^{2})\" alt=\"O(n^{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/780\/838\/654\/78083865448c84bd441bed7b9de24b0a.svg\" width=\"50\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b0\/aa4\/d67\/8b0aa4d670afce3deb7f39c851248046.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Heap  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/372\/6c0\/ce3\/3726c0ce3da9aeee36aeaf9976b2b116.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/275\/ecc\/fbc\/275eccfbcc36be1618ee62a75cde4667.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/973\/39b\/ae3\/97339bae3a2e1259986848fd4623d04e.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/702\/d9b\/9a2\/702d9b9a20e7fe61105bc2863efc72b5.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">MSDRadix  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times k)\" alt=\"O(n\\times k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/818\/555\/6a7\/8185556a7558b2c055503b47999e0ebb.svg\" width=\"75\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times k)\" alt=\"O(n\\times k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cf0\/c93\/d85\/cf0c93d85fa3b8018acb78f18f9aa863.svg\" width=\"75\" height=\"22\"\/><\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n\\times logn)\" alt=\"O(n\\times logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4fc\/b62\/7f0\/4fcb627f0bed9ae5f7bfbc407b8f065f.svg\" width=\"101\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/891\/72b\/542\/89172b542b7918ffd49c016526dbd81c.svg\" width=\"41\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432<\/h2>\n<h2>Bubble  <\/h2>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u043f\u0440\u043e\u0445\u043e\u0434\u0430\u0445 \u043f\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0443. \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0438, \u0435\u0441\u043b\u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432 \u043f\u0430\u0440\u0435 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439, \u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0435\u043d\u044f\u044e\u0442 \u043c\u0435\u0441\u0442\u0430\u043c\u0438. \u0417\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u0441\u0442\u0430\u0435\u0442 \u043d\u0430 \u0441\u0432\u043e\u0435 \u043c\u0435\u0441\u0442\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"n-1\" alt=\"n-1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/564\/041\/250\/5640412501386a254a66fe23a602c0b9.svg\" width=\"45\" height=\"17\"\/>\u043f\u0440\u043e\u0445\u043e\u0434\u043e\u0432, \u0433\u0434\u0435\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3da\/889\/f09\/3da889f094aa1ca0203ef149843b53cc.svg\" width=\"12\" height=\"12\"\/>\u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u043c, \u043d\u0430 \u0432\u0445\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a[0..n-1]\" alt=\"a[0..n-1]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7fe\/1c4\/cca\/7fe1c4cca37249fb1efcb3a63c63fda2.svg\" width=\"86\" height=\"22\"\/>.<\/p>\n<pre><code class=\"cs\">        public static void Bubble(ref int[] array) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u043c         {             var len = array.Length;             for (var i = 1; i &lt; len; i++)             {                 for (var j = 0; j &lt; len - i; j++)                 {                     if (array[j] > array[j + 1])                     {                         Swap(ref array[j], ref array[j + 1]);                     }                 }             }          }<\/code><\/pre>\n<h3>10 -> 2000 \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/485\/523\/2d9\/4855232d90961412cfe03a6a377b4f2d.PNG\" width=\"740\" height=\"363\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 2000 \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0435<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/35a\/6f0\/a2f\/35a6f0a2f634021e5a273a92595d91ca.PNG\" width=\"717\" height=\"362\"\/><figcaption><\/figcaption><\/figure>\n<h2>Shaker<\/h2>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043e\u043d \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443, \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u0430\u043c\u0438. \u041f\u0440\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0446\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0432\u044b\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0438 \u043c\u0435\u043b\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u043a\u043e\u043d\u0435\u0446 \u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.  <\/p>\n<pre><code class=\"cs\">public static void Shaker(ref int[] array) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u0435\u043c         {             for (var i = 0; i &lt; array.Length \/ 2; i++)             {                 var swapFlag = false;                 \/\/\u043f\u0440\u043e\u0445\u043e\u0434 \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e                 for (var j = i; j &lt; array.Length - i - 1; j++)                 {                     if (array[j] > array[j + 1])                     {                         Swap(ref array[j], ref array[j + 1]);                         swapFlag = true;                     }                 }                  \/\/\u043f\u0440\u043e\u0445\u043e\u0434 \u0441\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u043e                 for (var j = array.Length - 2 - i; j > i; j--)                 {                     if (array[j - 1] > array[j])                     {                         Swap(ref array[j - 1], ref array[j]);                         swapFlag = true;                     }                 }                  \/\/\u0435\u0441\u043b\u0438 \u043e\u0431\u043c\u0435\u043d\u043e\u0432 \u043d\u0435 \u0431\u044b\u043b\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u043c                 if (!swapFlag)                 {                     break;                 }             }          }<\/code><\/pre>\n<h2> 10 -> 2000 Synthetic<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e2f\/425\/757\/e2f4257573430acceb9f4e9b4980abe6.PNG\" width=\"736\" height=\"363\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/072\/701\/d72\/072701d72828c42a4e054783e9577147.PNG\" width=\"742\" height=\"360\"\/><figcaption><\/figcaption><\/figure>\n<h2>Insertion <\/h2>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c: \u0435\u0441\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0436\u0435 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0432 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0448\u0430\u0433\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0434\u0438\u043d \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u043d\u0443\u0436\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0432 \u0443\u0436\u0435 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440 \u043f\u043e\u043a\u0430 \u0432\u0435\u0441\u044c \u043d\u0430\u0431\u043e\u0440 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d. \u041c\u0435\u0442\u043e\u0434 \u0432\u044b\u0431\u043e\u0440\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u0435\u043d, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u0431\u044b\u0447\u043d\u043e (\u0438 \u0441 \u0446\u0435\u043b\u044c\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438), \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0438\u0445 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435.  <\/p>\n<pre><code class=\"cs\">        public static void Insertion(ref int[] array) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u0441\u0442\u0430\u0432\u043a\u0430\u043c\u0438         {             int n = array.Length;             for (int i = 1; i &lt; n; ++i)             {                 int key = array[i];                 int j = i - 1;                  \/\/ Move elements of arr[0..i-1],                 \/\/ that are greater than key,                 \/\/ to one position ahead of                 \/\/ their current position                 while (j >= 0 &amp;&amp; array[j] > key)                 {                     array[j + 1] = array[j];                     j = j - 1;                 }                 array[j + 1] = key;             }         }<\/code><\/pre>\n<h3>10 -> 2000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fd8\/e0b\/749\/fd8e0b74951ef2e6a595cc2a733790bc.PNG\" width=\"741\" height=\"365\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d32\/ecc\/b07\/d32eccb07fd32443fcf21fd550fcef9a.PNG\" width=\"741\" height=\"360\"\/><figcaption><\/figcaption><\/figure>\n<h2>Stooge  <\/h2>\n<p>\u00a0\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438. \u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u0440\u0430\u0439\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438  <\/p>\n<p>A\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435, \u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c 3 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u0441\u043f\u0438\u0441\u043a\u0430, \u0442\u043e:<\/p>\n<ul>\n<li>\n<p>\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c Stooge sort \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u044b\u0445 2\/3 \u0441\u043f\u0438\u0441\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c Stooge sort \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 2\/3 \u0441\u043f\u0438\u0441\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c Stooge sort \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u044b\u0445 2\/3 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u043d\u043e\u0432\u0430<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0418\u043d\u0430\u0447\u0435: return<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">        public static void Stooge(ref int[] array, int startIndex, int endIndex) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c         {             if (array[startIndex] > array[endIndex])             {                 Swap(ref array[startIndex], ref array[endIndex]);             }              if (endIndex - startIndex > 1)             {                 var len = (endIndex - startIndex + 1) \/ 3;                 Stooge(ref array, startIndex, endIndex - len);                 Stooge(ref array, startIndex + len, endIndex);                 Stooge(ref array, startIndex, endIndex - len);             }          }         public static void Stooge(ref int[] array) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c         {             Stooge(ref array, 0, array.Length - 1);         }<\/code><\/pre>\n<h3>10 -> 1000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f7e\/f38\/845\/f7ef388452773649d94a59ab4958d0c8.PNG\" width=\"734\" height=\"364\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 1000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1ac\/d55\/b30\/1acd55b30a94a924d85a91412d3cd7ca.PNG\" width=\"735\" height=\"364\"\/><figcaption><\/figcaption><\/figure>\n<h2>Pancake  <\/h2>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430\u044f \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435\u00a0\u2014 \u043f\u0435\u0440\u0435\u0432\u043e\u0440\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043e \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439, \u0432 \u0431\u043b\u0438\u043d\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0440\u043e\u0442\u043e\u0432. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u0441\u0442\u043e\u043f\u043a\u0443\u00a0\u0431\u043b\u0438\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0442\u0430\u0441\u0443\u044e\u0442 \u043f\u0443\u0442\u0451\u043c \u0432\u0437\u044f\u0442\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u043b\u0438\u043d\u043e\u0432 \u0441\u0432\u0435\u0440\u0445\u0443 \u0438 \u0438\u0445 \u043f\u0435\u0440\u0435\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f  <\/p>\n<pre><code class=\"cs\">        public static void Pancake(ref int[] array) \/\/\u0431\u043b\u0438\u043d\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430         {             for (var subArrayLength = array.Length - 1; subArrayLength >= 0; subArrayLength--)             {                 \/\/\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u0434\u043c\u0430\u0441\u0441\u0438\u0432\u0430                 var indexOfMax = IndexOfMax(array, subArrayLength);                 if (indexOfMax != subArrayLength)                 {                     \/\/\u043f\u0435\u0440\u0435\u0432\u043e\u0440\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430                     \/\/\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0441\u044f \u0432\u043d\u0430\u0447\u0430\u043b\u0435                     Flip(array, indexOfMax);                     \/\/\u043f\u0435\u0440\u0435\u0432\u043e\u0440\u043e\u0442 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u043c\u0430\u0441\u0441\u0438\u0432\u0430                     Flip(array, subArrayLength);                 }             }          }<\/code><\/pre>\n<h3>10 -> 2000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9ab\/ac7\/fa9\/9abac7fa99054f544320fbbb8f83d4b0.PNG\" width=\"732\" height=\"366\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 2000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/545\/22c\/b15\/54522cb150cc4b58d9d0d9a794563b2e.PNG\" width=\"727\" height=\"358\"\/><figcaption><\/figcaption><\/figure>\n<h2>Shell  <\/h2>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434 \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"h_{i}\" alt=\"h_{i}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/44a\/65f\/592\/44a65f5925359788a34230221cc2598e.svg\" width=\"18\" height=\"20\"\/>, \u0442\u0430\u043a\u0438\u043c, \u0447\u0442\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043e\u0442\u0441\u0442\u0430\u044e\u0449\u0438\u0435 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u043d\u0430\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"h_{i}\" alt=\"h_{i}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/13d\/4e5\/79c\/13d4e579c13f4161ee7eb95c3f1febbf.svg\" width=\"18\" height=\"20\"\/>\u043f\u043e\u0437\u0438\u0446\u0438\u0439. \u0428\u0435\u043b\u043b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"h_{i}=N\/2,\u00a0h_{t-1}=h_{t}\/2,\u00a0\u2026\u2026\u00a0,\u00a0h_{0}=1\" alt=\"h_{i}=N\/2,\u00a0h_{t-1}=h_{t}\/2,\u00a0\u2026\u2026\u00a0,\u00a0h_{0}=1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a3b\/0d9\/f59\/a3b0d9f598536ce2a78e9f671e84a01b.svg\" width=\"311\" height=\"22\"\/>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f, \u043d\u043e\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"h_{i} =1\" alt=\"h_{i} =1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/851\/54e\/5f9\/85154e5f978486dfa0a50752b5818037.svg\" width=\"53\" height=\"20\"\/>\u0432\u0441\u0435\u0433\u0434\u0430.<\/p>\n<ul>\n<li>\n<p>\u041d\u0430\u0447\u0430\u043b\u043e.<\/p>\n<\/li>\n<li>\n<p><strong>\u0428\u0430\u0433 0.<\/strong> <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"i=t\" alt=\"i=t\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5c3\/5d2\/b00\/5c35d2b00359b61ad3ace344ab11252f.svg\" width=\"39\" height=\"16\"\/>.<\/p>\n<\/li>\n<li>\n<p><strong>\u0428\u0430\u0433 1.<\/strong>\u00a0\u0420\u0430\u0437\u043e\u0431\u044c\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043e\u0442\u0441\u0442\u0430\u044e\u0449\u0438\u0445 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u043d\u0430\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"h_{i}\" alt=\"h_{i}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a2f\/a86\/b87\/a2fa86b874df273de5abd32af8b2e568.svg\" width=\"18\" height=\"20\"\/>\u0422\u0430\u043a\u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0431\u0443\u0434\u0435\u0442\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"h_{i}\" alt=\"h_{i}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/747\/6c8\/4f0\/7476c84f0da15f9c6d7d95499431e498.svg\" width=\"18\" height=\"20\"\/><\/p>\n<\/li>\n<li>\n<p><strong>\u0428\u0430\u0433 2.<\/strong>\u00a0\u041e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430\u00a0\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0428\u0430\u0433 3.<\/strong>\u00a0\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043c \u0441\u043f\u0438\u0441\u043a\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043c\u0430\u0441\u0441\u0438\u0432. \u0423\u043c\u0435\u043d\u044c\u0448\u0438\u043c\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/207\/c67\/ffc\/207c67ffcc33ec39425fcfe2be14968e.svg\" width=\"7\" height=\"16\"\/>. \u0415\u0441\u043b\u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/256\/c6f\/81a\/256c6f81adec6cda1079a83bfa405cef.svg\" width=\"7\" height=\"16\"\/>\u043d\u0435\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u00a0  \u2014 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u0448\u0430\u0433\u0443 1<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0435\u0446.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">        public static void Shell(ref int[] array) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0428\u0435\u043b\u043b\u0430         {             \/\/\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f             var d = array.Length \/ 2;             while (d >= 1)             {                 for (var i = d; i &lt; array.Length; i++)                 {                     var j = i;                     while ((j >= d) &amp;&amp; (array[j - d] > array[j]))                     {                         Swap(ref array[j], ref array[j - d]);                         j = j - d;                     }                 }                  d = d \/ 2;             }          }<\/code><\/pre>\n<h3>10 -> 10000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b82\/d1f\/c10\/b82d1fc10dc327ed85a05ca34cd81b2a.PNG\" width=\"736\" height=\"358\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/344\/273\/b30\/344273b302b2368acb4984eb4957905a.PNG\" width=\"730\" height=\"359\"\/><figcaption><\/figcaption><\/figure>\n<h2>Merge  <\/h2>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u00ab\u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0439 \u0438 \u0432\u043b\u0430\u0441\u0442\u0432\u0443\u0439\u00bb: \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0434\u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043b\u0438\u044f\u043d\u0438\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<ol>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0442\u043e \u043e\u043d \u0443\u0436\u0435 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u2014 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0430\u0447\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043a \u043d\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441\u043b\u0438\u044f\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e \u0434\u0432\u0443\u043c \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0447\u0430\u0441\u0442\u044f\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">        private static void merge(int[] arr, int l, int m, int r)         {             \/\/ original array is broken in two parts               \/\/ left and right array               int len1 = m - l + 1, len2 = r - m;             int[] left = new int[len1];             int[] right = new int[len2];              for (int x = 0; x &lt; len1; x++)                 left[x] = arr[l + x];              for (int x = 0; x &lt; len2; x++)                 right[x] = arr[m + 1 + x];              int i = 0;             int j = 0;             int k = l;              \/\/ after comparing, we merge those two array               \/\/ in larger sub array               while (i &lt; len1 &amp;&amp; j &lt; len2)             {                 if (left[i] &lt;= right[j])                 {                     arr[k] = left[i];                     i++;                 }                 else                 {                     arr[k] = right[j];                     j++;                 }                 k++;             }              \/\/ copy remaining elements of left, if any               while (i &lt; len1)             {                 arr[k] = left[i];                 k++;                 i++;             }              \/\/ copy remaining element of right, if any               while (j &lt; len2)             {                 arr[k] = right[j];                 k++;                 j++;             }         }         public static void Merge(ref int[] array) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0441\u043b\u0438\u044f\u043d\u0438\u0435\u043c         {             MergeSort(array, 0, array.Length - 1);         }<\/code><\/pre>\n<h3>10 -> 10000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/836\/38b\/c6e\/83638bc6e81c6dbe6a49241a416ab7ff.PNG\" width=\"741\" height=\"360\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b7d\/66e\/238\/b7d66e238d60e6d1bf48807fa547ce2a.PNG\" width=\"731\" height=\"367\"\/><figcaption><\/figcaption><\/figure>\n<h2>Selection  <\/h2>\n<p>\u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e04\/bd1\/28f\/e04bd128f06bf8d939bdc9dac6069df4.svg\" width=\"7\" height=\"16\"\/>-\u043e\u043c \u0448\u0430\u0433\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/09e\/15d\/8e0\/09e15d8e0ad7cd41592cb4a1127987d0.svg\" width=\"7\" height=\"16\"\/>-\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0441\u00a0 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/da1\/9cd\/ea7\/da19cdea750926c096002300e25c5287.svg\" width=\"7\" height=\"16\"\/>-\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u043c\u0430\u0441\u0441\u0438\u0432, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e \u043d\u0435 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e.<\/p>\n<pre><code class=\"cs\">        public static void Selection(ref int[] array, int currentIndex = 0) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u044b\u0431\u043e\u0440\u043e\u043c         {             if (currentIndex == array.Length)                 return;              var index = IndexOfMin(array, currentIndex);             if (index != currentIndex)             {                 Swap(ref array[index], ref array[currentIndex]);             }               Selection(ref array, currentIndex + 1);         }<\/code><\/pre>\n<p>  10 -> 2000 Synthetic<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dcb\/b26\/dd3\/dcbb26dd3d086a9e80747200541f2edc.PNG\" width=\"737\" height=\"368\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 2000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/995\/ced\/7bf\/995ced7bfde6b786798cc9c35e1abd33.PNG\" width=\"733\" height=\"356\"\/><figcaption><\/figcaption><\/figure>\n<h2>Quick  <\/h2>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442 \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 &#171;\u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0439 \u0438 \u0432\u043b\u0430\u0441\u0442\u0432\u0443\u0439&#187;.<\/p>\n<ul>\n<li>\n<p>\u041c\u0430\u0441\u0441\u0438\u0432\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a[l\u2026r]\" alt=\"a[l\u2026r]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/954\/11f\/ee0\/95411fee0023e9183db29d0f12f19816.svg\" width=\"64\" height=\"22\"\/>\u0442\u0438\u043f\u0430\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"T\" alt=\"T\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c78\/344\/571\/c78344571226c73be94ba08187a5fa05.svg\" width=\"14\" height=\"17\"\/>\u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0430 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0443\u0441\u0442\u044b\u0445) \u043f\u043e\u0434 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a[l\u2026q]\" alt=\"a[l\u2026q]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/553\/dd1\/f17\/553dd1f17fe71c61298327789ce4938e.svg\" width=\"65\" height=\"22\"\/>\u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a[q+1\u2026r]\" alt=\"a[q+1\u2026r]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/de5\/6d6\/c47\/de56d6c47233f3d14da5b49482b839ff.svg\" width=\"101\" height=\"22\"\/>, \u0442\u0430\u043a\u0438\u0445, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a[l\u2026q]\" alt=\"a[l\u2026q]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/70f\/4e5\/614\/70f4e5614848fe86822c02d816613f16.svg\" width=\"65\" height=\"22\"\/>\u00a0\u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u0435\u043d\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a[q]\" alt=\"a[q]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/db9\/9db\/0c9\/db99db0c9502aeb8c5b8ec7a3e8ac764.svg\" width=\"30\" height=\"22\"\/>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e\u0434 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a[q+1\u2026r]\" alt=\"a[q+1\u2026r]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a1e\/771\/0af\/a1e7710af5d524f77a326e5600c5ec42.svg\" width=\"101\" height=\"22\"\/>. \u0418\u043d\u0434\u0435\u043a\u0441 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0445\u043e\u0434\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434 \u043c\u0430\u0441\u0441\u0438\u0432\u044b\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a[l\u2026q]\" alt=\"a[l\u2026q]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a64\/c10\/277\/a64c10277c46da0d2967b1351152c187.svg\" width=\"65\" height=\"22\"\/>\u00a0\u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a[q+1\u2026r]\" alt=\"a[q+1\u2026r]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/492\/6b9\/b98\/4926b9b98442c78b3c0b46affc745c4e.svg\" width=\"101\" height=\"22\"\/>\u00a0\u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e\u0434 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u0434\u043b\u044f \u0438\u0445 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f: \u0432\u0435\u0441\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a[l\u2026r]\" alt=\"a[l\u2026r]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/239\/cf1\/8ec\/239cf18ec80f362c6065a02ba4f414d3.svg\" width=\"64\" height=\"22\"\/>\u00a0\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">        static int[] QuickSort(int[] array, int minIndex, int maxIndex) \/\/\u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430         {             if (minIndex >= maxIndex)             {                 return array;             }              var pivotIndex = Partition(array, minIndex, maxIndex);             QuickSort(array, minIndex, pivotIndex - 1);             QuickSort(array, pivotIndex + 1, maxIndex);              return array;         }         public static void Quick(ref int[] array) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0425\u043e\u0430\u0440\u0430         {             QuickSort(array, 0, array.Length - 1);         }<\/code><\/pre>\n<h3>10 -> 2000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e74\/84d\/18f\/e7484d18f684c7f56086ac3407c3dc74.PNG\" width=\"741\" height=\"366\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/842\/8ff\/7a7\/8428ff7a78df90771d8623e9bd68b7b6.PNG\" width=\"735\" height=\"357\"\/><figcaption><\/figcaption><\/figure>\n<h2>Gnome  <\/h2>\n<p>\u0413\u043d\u043e\u043c\u044c\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0442\u0435\u0445\u043d\u0438\u043a\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0433\u043e\u043b\u043b\u0430\u043d\u0434\u0441\u043a\u0438\u043c \u0441\u0430\u0434\u043e\u0432\u044b\u043c \u0433\u043d\u043e\u043c\u043e\u043c. \u042d\u0442\u043e \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0430\u0434\u043e\u0432\u044b\u0439 \u0433\u043d\u043e\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u043b\u0438\u043d\u0438\u044e \u0446\u0432\u0435\u0442\u043e\u0447\u043d\u044b\u0445 \u0433\u043e\u0440\u0448\u043a\u043e\u0432. \u041f\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443 \u043e\u043d \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0441\u0430\u0434\u043e\u0432\u044b\u0435 \u0433\u043e\u0440\u0448\u043a\u0438: \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043e\u043d \u0448\u0430\u0433\u0430\u0435\u0442 \u043d\u0430 \u043e\u0434\u0438\u043d \u0433\u043e\u0440\u0448\u043e\u043a \u0432\u043f\u0435\u0440\u0451\u0434, \u0438\u043d\u0430\u0447\u0435 \u043e\u043d \u043c\u0435\u043d\u044f\u0435\u0442 \u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0448\u0430\u0433\u0430\u0435\u0442 \u043d\u0430 \u043e\u0434\u0438\u043d \u0433\u043e\u0440\u0448\u043e\u043a \u043d\u0430\u0437\u0430\u0434. \u0413\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f: \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0433\u043e\u0440\u0448\u043a\u0430, \u043e\u043d \u0448\u0430\u0433\u0430\u0435\u0442 \u0432\u043f\u0435\u0440\u0451\u0434; \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0433\u043e\u0440\u0448\u043a\u0430, \u043e\u043d \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b.  <\/p>\n<pre><code class=\"cs\">        public static void Gnome(ref int[] unsortedArray) \/\/\u0413\u043d\u043e\u043c\u044c\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430         {             var index = 1;             var nextIndex = index + 1;              while (index &lt; unsortedArray.Length)             {                 if (unsortedArray[index - 1] &lt; unsortedArray[index])                 {                     index = nextIndex;                     nextIndex++;                 }                 else                 {                     Swap(ref unsortedArray[index - 1], ref unsortedArray[index]);                     index--;                     if (index == 0)                     {                         index = nextIndex;                         nextIndex++;                     }                 }             }         }<\/code><\/pre>\n<h3>10 -> 2000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/559\/d47\/c23\/559d47c23b562c4c9b2bd17768715586.PNG\" width=\"745\" height=\"359\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/10b\/746\/04a\/10b74604a8d6ee37c2dec13c6ec49084.PNG\" width=\"735\" height=\"357\"\/><figcaption><\/figcaption><\/figure>\n<h2>Tree  <\/h2>\n<p>\u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439\u00a0\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438\u00a0\u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u043f\u043e\u0438\u0441\u043a\u0430\u00a0\u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (\u0441\u043f\u0438\u0441\u043a\u0430), \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0431\u043e\u0440\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0443\u0442\u0451\u043c \u043e\u0431\u0445\u043e\u0434\u0430 \u0443\u0437\u043b\u043e\u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0443\u0442\u0451\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u0437\u00a0\u043f\u043e\u0442\u043e\u043a\u0430\u00a0(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0430\u0439\u043b\u0430, \u0441\u043e\u043a\u0435\u0442\u0430 \u0438\u043b\u0438 \u043a\u043e\u043d\u0441\u043e\u043b\u0438).  <\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0443\u0442\u0451\u043c \u043e\u0431\u0445\u043e\u0434\u0430 \u0443\u0437\u043b\u043e\u0432 \u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">class TreeNode \/\/\u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430     {         public TreeNode(int data)         {             Data = data;         }         public int Data { get; set; } \/\/\u0434\u0430\u043d\u043d\u044b\u0435         public TreeNode Left { get; set; } \/\/\u043b\u0435\u0432\u0430\u044f \u0432\u0435\u0442\u043a\u0430 \u0434\u0435\u0440\u0435\u0432\u0430         public TreeNode Right { get; set; } \/\/\u043f\u0440\u0430\u0432\u0430\u044f \u0432\u0435\u0442\u043a\u0430 \u0434\u0435\u0440\u0435\u0432\u0430         public void Insert(TreeNode node) \/\/\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0443\u0437\u043b\u0430 \u0432 \u0434\u0435\u0440\u0435\u0432\u043e         {             if (node.Data &lt; Data)             {                 if (Left == null)                 {                     Left = node;                 }                 else                 {                     Left.Insert(node);                 }             }             else             {                 if (Right == null)                 {                     Right = node;                 }                 else                 {                     Right.Insert(node);                 }             }         }         public int[] Transform(List&lt;int> elements = null) \/\/\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432         {             if (elements == null)             {                 elements = new List&lt;int>();             }              if (Left != null)             {                 Left.Transform(elements);             }              elements.Add(Data);              if (Right != null)             {                 Right.Transform(elements);             }              return elements.ToArray();         }     }         public static void Tree(ref int[] array) \/\/\u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430         {             var treeNode = new TreeNode(array[0]);             for (int i = 1; i &lt; array.Length; i++)             {                 treeNode.Insert(new TreeNode(array[i]));             }              array = treeNode.Transform();         }<\/code><\/pre>\n<h3>10 -> 2000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f2c\/288\/b84\/f2c288b847a3409d40bac1c823423005.PNG\" width=\"737\" height=\"364\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 2000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9cc\/f88\/c7f\/9ccf88c7f5f2bfe771e93cc166b85ef3.PNG\" width=\"738\" height=\"359\"\/><figcaption><\/figcaption><\/figure>\n<h2>Comb  <\/h2>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u043e\u043d\u044b \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 \u043e\u043d\u0438 \u043d\u0435\u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0434\u0440\u0443\u0433 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433\u0430 &#8212; \u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u043c\u0435\u043d. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0438\u0433\u0440\u0438\u0440\u0443\u044e\u0442 \u0432 \u043a\u043e\u043d\u0435\u0446 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e &#8212; \u0432 \u043d\u0430\u0447\u0430\u043b\u043e.  <\/p>\n<pre><code class=\"cs\">public static void Comb(ref int[] array) \/\/\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0440\u0430\u0441\u0447\u0435\u0441\u043a\u043e\u0439         {             var arrayLength = array.Length;             var currentStep = arrayLength - 1;              while (currentStep > 1)             {                 for (int i = 0; i + currentStep &lt; array.Length; i++)                 {                     if (array[i] > array[i + currentStep])                     {                         Swap(ref array[i], ref array[i + currentStep]);                     }                 }                  currentStep = GetNextStep(currentStep);             }              \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u043c             for (var i = 1; i &lt; arrayLength; i++)             {                 var swapFlag = false;                 for (var j = 0; j &lt; arrayLength - i; j++)                 {                     if (array[j] > array[j + 1])                     {                         Swap(ref array[j], ref array[j + 1]);                         swapFlag = true;                     }                 }                  if (!swapFlag)                 {                     break;                 }             }         }<\/code><\/pre>\n<h3>10 -> 10000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/97b\/c20\/a02\/97bc20a0210a187be1d9d23da3d759e0.PNG\" width=\"741\" height=\"362\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/192\/ed0\/80a\/192ed080a6b0a57130b7fe8c750025e5.PNG\" width=\"734\" height=\"361\"\/><figcaption><\/figcaption><\/figure>\n<h2>BasicCounting  <\/h2>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0447\u0438\u0441\u0435\u043b \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e\u00a0\u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u043e\u043c \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u043b\u0438\u0448\u044c \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0438\u043c\u0435\u044e\u0442 (\u0438\u043b\u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432) \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u0430\u043b \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0438\u043b\u043b\u0438\u043e\u043d \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043c\u0435\u043d\u044c\u0448\u0438\u0445 1000.  <\/p>\n<pre><code class=\"cs\">public static void BasicCounting(ref int[] array) \/\/\u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u043e\u043c         {             int n = array.Length;             int max = 0;             for (int i = 0; i &lt; n; i++)             {                 if (max &lt; array[i])                 {                     max = array[i];                 }             }              int[] freq = new int[max + 1];             for (int i = 0; i &lt; max + 1; i++)             {                 freq[i] = 0;             }             for (int i = 0; i &lt; n; i++)             {                 freq[array[i]]++;             }              for (int i = 0, j = 0; i &lt;= max; i++)             {                 while (freq[i] > 0)                 {                     array[j] = i;                     j++;                     freq[i]--;                 }             }         }<\/code><\/pre>\n<h3>10 -> 100000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6f8\/0b5\/461\/6f80b5461ef9f1b2940bab8e942f29c7.PNG\" width=\"728\" height=\"362\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 100000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fc3\/cee\/bc1\/fc3ceebc1544540a679e6fb5f32f30cb.PNG\" width=\"734\" height=\"356\"\/><figcaption><\/figcaption><\/figure>\n<h2>CombinedBubble  <\/h2>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u043f\u0440\u043e\u0445\u043e\u0434\u043e\u0432 \u043f\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0443. \u0417\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043f\u0430\u0440\u043d\u043e \u0438, \u0435\u0441\u043b\u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432 \u043f\u0430\u0440\u0435 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u0440\u043e\u0445\u043e\u0434\u044b \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f  <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"N-1\" alt=\"N-1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ef\/b1e\/ecf\/5efb1eecf3a242e7ade329d6aeca5b59.svg\" width=\"50\" height=\"18\"\/> \u0440\u0430\u0437 \u0438\u043b\u0438 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435 \u043d\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u0431\u043c\u0435\u043d\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u00a0\u2014 \u043c\u0430\u0441\u0441\u0438\u0432 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d. \u041f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c\u0443 \u0446\u0438\u043a\u043b\u0443 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0432\u043e\u0451 \u043c\u0435\u0441\u0442\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0440\u044f\u0434\u043e\u043c \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u00ab\u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c\u00bb, \u0430 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u0443 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043a \u043d\u0430\u0447\u0430\u043b\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (\u00ab\u0432\u0441\u043f\u043b\u044b\u0432\u0430\u0435\u0442\u00bb \u0434\u043e \u043d\u0443\u0436\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u043a\u0430\u043a \u043f\u0443\u0437\u044b\u0440\u0451\u043a \u0432 \u0432\u043e\u0434\u0435\u00a0\u2014 \u043e\u0442\u0441\u044e\u0434\u0430 \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430).  <\/p>\n<pre><code class=\"cs\">public static void CombinedBubble(ref int[] array)         {             int length = array.Length;              int temp = array[0];              for (int i = 0; i &lt; length; i++)             {                 for (int j = i + 1; j &lt; length; j++)                 {                     if (array[i] > array[j])                     {                         temp = array[i];                          array[i] = array[j];                          array[j] = temp;                     }                 }             }         }<\/code><\/pre>\n<h3>10 -> 2000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6ce\/854\/bd4\/6ce854bd4104d76661b32c1f11061fa7.PNG\" width=\"729\" height=\"360\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 2000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f95\/2e0\/e5b\/f952e0e5b4b9a35a142e3f72ae5af41f.PNG\" width=\"732\" height=\"363\"\/><figcaption><\/figcaption><\/figure>\n<h2>Heapify  <\/h2>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u00a0 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A\" alt=\"A\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/129\/b42\/978\/129b4297828cc09e08a260839eb8799d.svg\" width=\"14\" height=\"17\"\/>, \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b\" alt=\"b\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8ff\/bf7\/550\/8ffbf7550e09e03f4635b9d2e51533a7.svg\" width=\"8\" height=\"17\"\/>. \u041f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u043d\u0430 \u0431\u0430\u0437\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0437\u0430\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(n)\" alt=\"O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e1d\/47d\/040\/e1d47d040319cbb489e80f68bdcd27b0.svg\" width=\"41\" height=\"22\"\/>\u00a0\u043a\u0443\u0447\u0443 \u0434\u043b\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430. \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u0440\u043d\u0435, \u0442\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0441\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A[n\u22121]\" alt=\"A[n\u22121]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/949\/321\/e41\/949321e414e938df1f429f6074ad169e.svg\" width=\"70\" height=\"22\"\/>, \u043e\u043d \u0432\u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0430 \u0441\u0432\u043e\u0451 \u043c\u0435\u0441\u0442\u043e. \u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"siftDown(0)\" alt=\"siftDown(0)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a1b\/504\/cd4\/a1b504cd4387b9dfd7c6bc2392bfe4b2.svg\" width=\"109\" height=\"22\"\/>, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0432\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"heapSize\" alt=\"heapSize\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ad1\/b5a\/898\/ad1b5a8987846db9aa30a787c396f466.svg\" width=\"77\" height=\"20\"\/> \u043d\u0430\u00a01. \u041e\u043d\u0430 \u0437\u0430\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(logn)\" alt=\"O(logn)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b15\/999\/30e\/b1599930ee3fbff4d82925796294a59c.svg\" width=\"66\" height=\"22\"\/>\u00a0\u043f\u0440\u043e\u0441\u0435\u0435\u0442\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A[0]\" alt=\"A[0]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/329\/8bd\/596\/3298bd596b9a12be5a0cdbb0608689f4.svg\" width=\"35\" height=\"22\"\/>\u00a0\u043d\u0430 \u043d\u0443\u0436\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0438 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u043a\u0443\u0447\u0443 (\u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043b\u0438 \u0435\u0451 \u0440\u0430\u0437\u043c\u0435\u0440, \u0442\u043e \u043a\u0443\u0447\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0441\u00a0 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A[0]\" alt=\"A[0]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/559\/466\/c01\/559466c010cbf9daa6c3403b756a6f16.svg\" width=\"35\" height=\"22\"\/>\u00a0\u043f\u043e\u00a0 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A[n\u22122]\" alt=\"A[n\u22122]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ce6\/390\/436\/ce63904364a1a89ee1dd169dd709baa1.svg\" width=\"70\" height=\"22\"\/>, \u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A[n\u22121]\" alt=\"A[n\u22121]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3e6\/927\/521\/3e69275212ce8dc2cfb8fb90d2316954.svg\" width=\"70\" height=\"22\"\/>\u00a0\u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043c\u0435\u0441\u0442\u0435). \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u044d\u0442\u0443 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0439 \u043a\u0443\u0447\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0440\u0435\u043d\u044c \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043d\u0435 \u0441\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A[n\u22121]\" alt=\"A[n\u22121]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2e8\/7ba\/f18\/2e87baf184ecd054d2c35c5cd7a13fce.svg\" width=\"70\" height=\"22\"\/>, \u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\u00a0A[n\u22122]\" alt=\"\u00a0A[n\u22122]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/721\/e6e\/718\/721e6e71853e00374205e281ef53406c.svg\" width=\"70\" height=\"22\"\/>. \u0414\u0435\u043b\u0430\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043f\u043e\u043a\u0430\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"heapSize\" alt=\"heapSize\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b75\/0b8\/d7b\/b750b8d7bef6a19325f7438be271f602.svg\" width=\"77\" height=\"20\"\/> \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0440\u0430\u0432\u0435\u043d\u00a01, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0438\u0437 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0447\u0438\u0441\u0435\u043b \u0432 \u043a\u043e\u043d\u0435\u0446 \u043d\u0435 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<pre><code class=\"cs\">        public static void Heapify(ref int[] array) \/\/ Heapify         {             for (int i = array.Length \/ 2 - 1; i >= 0; i--)                 Heapify(array, array.Length, i);              for (int i = array.Length - 1; i >= 0; i--)             {                 int temp = array[0];                 array[0] = array[i];                 array[i] = temp;                 Heapify(array, i, 0);             }         }<\/code><\/pre>\n<h3>10 -> 10000 Synthetic  <\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e70\/5c8\/c9c\/e705c8c9c7a0583d8e294e4342cefa43.PNG\" width=\"735\" height=\"358\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aad\/193\/1fa\/aad1931faeec8b9d716575a860197f67.PNG\" width=\"738\" height=\"361\"\/><figcaption><\/figcaption><\/figure>\n<h2>Cocktail  <\/h2>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043e\u043d \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443, \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u0430\u043c\u0438. \u041f\u0440\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0446\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0432\u044b\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0438 \u043c\u0435\u043b\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u043a\u043e\u043d\u0435\u0446 \u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u041a\u043e\u043a\u0442\u0435\u0439\u043b\u044c\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0435\u0449\u0451 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u043e\u0431\u043c\u0435\u043d\u0430\u043c\u0438. \u0415\u0441\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0434\u043b\u044f\u00a0\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0432\u044b\u0431\u043e\u0440\u043e\u043c.  <\/p>\n<pre><code class=\"cs\">public static void Cocktail(ref int[] array) \/\/ cocktail         {             int start = 0;             int end = array.Length - 1;             int temp;             bool swapped = true;              while (swapped)             {                 swapped = false;                  for (int i = 0; i &lt; end; i++)                 {                     if (array[i] > array[i + 1])                     {                         temp = array[i];                         array[i] = array[i + 1];                         array[i + 1] = temp;                         swapped = true;                     }                 }                  if (!swapped)                 {                     break;                 }                  swapped = false;                 end -= 1;                  for (int i = end; i >= start; i--)                 {                     if (array[i] > array[i + 1])                     {                         temp = array[i];                         array[i] = array[i + 1];                         array[i + 1] = temp;                         swapped = true;                     }                 }                  start += 1;             }         }<\/code><\/pre>\n<h3>10 -> 2000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/649\/639\/e69\/649639e69bf88a6eb33a05792c29fbe2.PNG\" width=\"735\" height=\"363\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a48\/16a\/795\/a4816a795a1c6aba4546c4b10714c1ef.PNG\" width=\"733\" height=\"357\"\/><figcaption><\/figcaption><\/figure>\n<h2>OddEven  <\/h2>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043e\u043d \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443, \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u0430\u043c\u0438. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u0432\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0448\u0430\u0433 \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0440\u0430\u0432\u0435\u043d \u0434\u0432\u0443\u043c, \u0430 \u043d\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u0435.  <\/p>\n<pre><code class=\"cs\">public static void OddEven(ref int[] array)         {             \/\/Initialization             int Flag = 0;             int temp = 0;              \/\/Initialize flag =0 or f!=1             while (Flag == 0)             {                  \/*Initialize Flag is 1                 When both if condiotion is false so the flag remain 1                  and the while loop is terminate*\/                  Flag = 1;                  \/\/use Even Loop for comparing even idexes of an array                   for (int i = 0; i &lt; array.Length - 1; i += 2)                 {                     \/* Use if conditon for comparing adjacents elements                                          if they are in wrong order than swap*\/                      if (array[i] > array[i + 1])                     {                          temp = array[i];                         array[i] = array[i + 1];                         array[i + 1] = temp;                         \/\/This Flag variable is always remain 0 when if condition is true                         Flag = 0;                     }                 }                   \/\/use Odd Loop for comparing odd idexes of an array                  for (int i = 1; i &lt; array.Length - 1; i += 2)                 {                      \/* Use if conditon for comparing adjacents elements                         if they are in wrong order than swap*\/                     if (array[i] > array[i + 1])                     {                         \/\/This Flag variable is always remain 0 when if condition is true                         temp = array[i];                         array[i] = array[i + 1];                         array[i + 1] = temp;                         Flag = 0;                     }                 }              }             \/\/return sorted array          } \/\/ OddEven<\/code><\/pre>\n<h3>10 -> 2000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b93\/b47\/013\/b93b47013db593b0eaf19c45748ae0c8.PNG\" width=\"739\" height=\"362\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 2000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a0f\/3ca\/1e7\/a0f3ca1e70221d695e14d13e1917e9f3.PNG\" width=\"736\" height=\"361\"\/><figcaption><\/figcaption><\/figure>\n<h2>Tim  <\/h2>\n<p>\u0433\u0438\u0431\u0440\u0438\u0434\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u0441\u043e\u0447\u0435\u0442\u0430\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b.<\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u043e\u0432\u044b\u043c \u0438 \u0431\u044b\u043b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d \u0422\u0438\u043c\u043e\u043c \u041f\u0435\u0442\u0435\u0440\u0441\u043e\u043c. \u041d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0434 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0422\u0438\u043c\u0430 \u041f\u0435\u0442\u0435\u0440\u0441\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0431\u044f \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043e\u043a. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f\u00a0<strong>Timsort<\/strong>\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0432\u00a0<strong>Python<\/strong>\u00a0\u0438\u00a0<strong>GNU Octave<\/strong>, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432\u00a0<strong>OpenJDK 7<\/strong>\u00a0\u0438\u00a0<strong>Android JDK 1.5<\/strong>.<\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u00a0<strong>Timsort<\/strong>\u00a0\u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<ul>\n<li>\n<p>\u041d\u0430\u0447\u0430\u043b\u043e.<\/p>\n<\/li>\n<li>\n<p><strong>\u0428\u0430\u0433 1<\/strong>. \u0412\u0445\u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0434\u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u043e\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p><strong>\u0428\u0430\u0433 2<\/strong>. \u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0434 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f\u00a0\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0430\u043c\u0438,\u00a0\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u043c\u00a0\u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>\u0428\u0430\u0433 3<\/strong>. \u041e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u0438\u043d \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439\u00a0\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043b\u0438\u044f\u043d\u0438\u0435\u043c.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0435\u0446.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">        public static void Tim(ref int[] array)         {             int RUN = 32;              for (int i = 0; i &lt; array.Length; i += RUN)                 insertionSort(array, i, Math.Min((i + 31), (array.Length - 1)));              for (int size = RUN; size &lt; array.Length; size = 2 * size)             {                 for (int left = 0; left &lt; array.Length; left += 2 * size)                 {                     int mid = left + size - 1;                     int right = Math.Min((left + 2 * size - 1), (array.Length - 1));                      merge(array, left, mid, right);                 }             }          } \/\/ Tim<\/code><\/pre>\n<h3>10 -> 20000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9e3\/8e9\/ee6\/9e38e9ee64c1738b7e1c921d6dfa828b.PNG\" width=\"721\" height=\"340\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 20000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/085\/050\/1a0\/0850501a05e6585b8f4a9744879b04ca.PNG\" width=\"726\" height=\"343\"\/><figcaption><\/figcaption><\/figure>\n<h2>Counting  <\/h2>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u044b\u00a0nn, \u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f, \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435\u00a0A. \u0422\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432\u00a0C\u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c\u0438 \u043e\u0442\u00a00 \u0434\u043e\u00a0 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"k\u22121\" alt=\"k\u22121\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/328\/4b5\/be1\/3284b5be19bdb9f5b1abc212bc44cd13.svg\" width=\"43\" height=\"18\"\/>, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u043d\u0443\u043b\u044f\u043c\u0438.<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0439\u0434\u0451\u043c \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443\u00a0A \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"C[i]\" alt=\"C[i]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ada\/bc3\/f15\/adabc3f156bfe2b029c8911a52d45837.svg\" width=\"32\" height=\"22\"\/>\u00a0\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u0438\u0441\u0435\u043b, \u0440\u0430\u0432\u043d\u044b\u0445\u00a0i.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443\u00a0C\u00a0\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"number\u2208{0,...,k\u22121}\" alt=\"number\u2208{0,...,k\u22121}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1b0\/eae\/3b2\/1b0eae3b20792f9718a3862bc3acbe80.svg\" width=\"185\" height=\"20\"\/>\u00a0\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u00a0A\u00a0\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u043e\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"C[number]\" alt=\"C[number]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/862\/69d\/faf\/86269dfafa2b81385e3234128db8fabe.svg\" width=\"91\" height=\"22\"\/>\u00a0\u0440\u0430\u0437.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">public static void Counting(ref int[] array)         {             int min = 0;             int max = 0;             for (int i = 0; i &lt; array.Length; i++)             {                 if (array[i] &lt; min)                     min = array[i];                 if (array[i] > max)                     max = array[i];             }              int[] count = new int[max - min + 1];             int z = 0;              for (int i = 0; i &lt; count.Length; i++)                 count[i] = 0;              for (int i = 0; i &lt; array.Length; i++)                 count[array[i] - min]++;              for (int i = min; i &lt;= max; i++)             {                 while (count[i - min]-- > 0)                 {                     array[z] = i;                     ++z;                 }             }          } \/\/ Counting<\/code><\/pre>\n<h3>10 -> 50000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c96\/8a0\/266\/c968a026626b6d6a73e5cc3ba068e160.PNG\" width=\"726\" height=\"342\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 50000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6af\/cfc\/d4e\/6afcfcd4e0a7ac70f1dde5464094ceda.PNG\" width=\"727\" height=\"339\"\/><figcaption><\/figcaption><\/figure>\n<h2>Bucket  <\/h2>\n<p>\u0414\u043b\u044f \u043a\u0430\u0440\u043c\u0430\u043d\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u00a0k\u00a0\u0431\u043b\u043e\u043a\u043e\u0432 (\u043a\u0430\u0440\u043c\u0430\u043d\u043e\u0432, \u043a\u043e\u0440\u0437\u0438\u043d). \u0414\u0430\u043b\u0435\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439, \u043b\u0438\u0431\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0442\u0435\u043c \u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f. \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043e\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u043d\u0430 \u0431\u043b\u043e\u043a\u0438. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043d\u0430 \u0431\u043b\u043e\u043a\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0431\u044b\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e.<\/p>\n<p>\u041a\u0430\u0440\u043c\u0430\u043d\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u0434\u0435\u0433\u0440\u0430\u0434\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0430\u043b\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 (\u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u0432 \u043e\u0434\u043d\u0443 \u043a\u043e\u0440\u0437\u0438\u043d\u0443). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u043e\u0439 \u0442\u0438\u043f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u0435\u043b\u0438\u043a\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0447\u0438\u0441\u043b\u0430 \u0440\u0435\u0434\u043a\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b).<\/p>\n<pre><code class=\"cs\"> public static void Bucket(ref int[] array)         {             int minValue = array[0];             int maxValue = array[0];              for (int i = 1; i &lt; array.Length; i++)             {                 if (array[i] > maxValue)                     maxValue = array[i];                 if (array[i] &lt; minValue)                     minValue = array[i];             }              List&lt;int>[] bucket = new List&lt;int>[maxValue - minValue + 1];              for (int i = 0; i &lt; bucket.Length; i++)             {                 bucket[i] = new List&lt;int>();             }              for (int i = 0; i &lt; array.Length; i++)             {                 bucket[array[i] - minValue].Add(array[i]);             }              int k = 0;             for (int i = 0; i &lt; bucket.Length; i++)             {                 if (bucket[i].Count > 0)                 {                     for (int j = 0; j &lt; bucket[i].Count; j++)                     {                         array[k] = bucket[i][j];                         k++;                     }                 }             }          } \/\/ Bucket<\/code><\/pre>\n<h3>10 -> 10000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ea\/5fa\/0ae\/5ea5fa0ae5a6ea4f384c4bd80022c049.PNG\" width=\"729\" height=\"336\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7bb\/70c\/6a5\/7bb70c6a5134787146634010b98f0984.PNG\" width=\"724\" height=\"342\"\/><figcaption><\/figcaption><\/figure>\n<h2>BinaryInsertion  <\/h2>\n<p>\u0414\u0432\u043e\u0438\u0447\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u0441\u0442\u0430\u0432\u043a\u0430\u043c\u0438 \u2014 \u044d\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043d\u0430\u00a0\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u0432\u0441\u0442\u0430\u0432\u043a\u0430\u043c\u0438\u00a0, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u0435\u0441\u0442\u0430, \u043a\u0443\u0434\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u00a0\u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a\u00a0.\u00a0\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441 O (N) \u0434\u043e O (log N).  <\/p>\n<pre><code class=\"cs\">        public static void BinaryInsertion(ref int[] array)         {             int count = 0;             for (int i = 0; i &lt; array.Length; i++)             {                 int tmp = array[i]; int left = 0; int right = i - 1;                 while (left &lt;= right)                 {                     int m = (left + right) \/ 2; \/\/\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430                     if (tmp &lt; array[m])                         right = m - 1; \/\/ \u0441\u0434\u0432\u0438\u0433 \u043f\u0440\u0430\u0432\u043e\u0439                     else left = m + 1; \/\/\u0438\u043b\u0438 \u043b\u0435\u0432\u043e\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u044b                     count++;                 }                  for (int j = i - 1; j >= left; j--)                 {                     array[j + 1] = array[j]; \/\/ \u0441\u0434\u0432\u0438\u0433 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432                                          \/\/ count++;                 }                  array[left] = tmp; \/\/ \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u043d\u0443\u0436\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e             }         } \/\/ BinaryInsertion<\/code><\/pre>\n<h3>10 -> 5000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/889\/650\/fef\/889650fefedd8c68e8144f5f4c32cc6c.PNG\" width=\"726\" height=\"344\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/792\/b11\/830\/792b1183080f2da3e3af3bb40bd55fd6.PNG\" width=\"728\" height=\"339\"\/><figcaption><\/figcaption><\/figure>\n<h2>Bogo  <\/h2>\n<p>\u041d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439\u00a0\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445 \u0438 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u0434\u0440\u0443\u0433\u0438\u043c, \u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c.  \u0415\u0441\u043b\u0438 bogosort \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\u00a0\u043a\u043e\u043b\u043e\u0434\u044b \u043a\u0430\u0440\u0442, \u0442\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043b\u0435\u0436\u0430\u0442 \u043b\u0438 \u0432\u0441\u0435 \u043a\u0430\u0440\u0442\u044b \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443, \u0438 \u0435\u0441\u043b\u0438 \u043d\u0435 \u043b\u0435\u0436\u0430\u0442, \u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u0448\u0430\u0442\u044c \u0435\u0451, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043b\u0435\u0436\u0430\u0442 \u043b\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u043a\u0430\u0440\u0442\u044b \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443, \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0442 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u043e\u0434\u0430.  <\/p>\n<pre><code class=\"cs\">        public static void Bogo(ref int[] array)         {             while (!sorted(array))             {                 Random rdm = new Random();                 for (int i = 0; i &lt; array.Length; i++)                 {                     {                          for (int u = 0; u &lt; array.Length; u++)                         {                             SwapBogo(ref array, u, rdm.Next(0, array.Length - 1));                         }                     }                 }              }          } \/\/ Bogo<\/code><\/pre>\n<h2>Cycle  <\/h2>\n<p>\u042d\u0442\u043e\u00a0\u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439\u00a0\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438\u00a0\u043d\u0430 \u043c\u0435\u0441\u0442\u0435,\u00a0\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430\u00a0\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c\u00a0, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0430 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439\u00a0\u043c\u0430\u0441\u0441\u0438\u0432\u00a0, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435.\u00a0\u041e\u043d \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0438\u0434\u0435\u0435, \u0447\u0442\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u0430\u044f\u00a0\u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\u00a0\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0442\u0430 \u043d\u0430\u00a0\u0446\u0438\u043a\u043b\u044b\u00a0, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.  <\/p>\n<pre><code class=\"cs\">        public static void Cycle(ref int[] array)         {             for (int i = 0; i &lt; array.Length - 1; i++)             {                 int item = array[i];                 int pos = i;                 for (int j = i + 1; j &lt; array.Length; j++)                 {                     if (array[j] &lt; item)                     {                         pos++;                     }                 }                 if (pos == i)                 {                     continue;                 }                 while (item == array[pos])                 {                     pos++;                 }                 int var = item;                 item = array[pos];                 array[pos] = var;                 while (pos != i)                 {                     pos = i;                     for (int j = i + 1; j &lt; array.Length; j++)                     {                         if (array[j] &lt; item)                         {                             pos++;                         }                     }                     while (item == array[pos])                     {                         pos++;                     }                     int temp = item;                     item = array[pos];                     array[pos] = temp;                 }             }          } \/\/ Cycle<\/code><\/pre>\n<h3>10 -> 3000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/81a\/8b2\/af9\/81a8b2af9781cbc66eae55992fdc72c7.PNG\" width=\"725\" height=\"341\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 3000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ad3\/350\/7ad\/ad33507ad2ad99ce7832720398d68690.PNG\" width=\"723\" height=\"342\"\/><figcaption><\/figcaption><\/figure>\n<h2>Exchange  <\/h2>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043e\u0431\u043c\u0435\u043d\u043e\u043c \u2014 \u044d\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442 \u0438\u0445 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043c\u0435\u043d\u044f\u044f \u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u00ab\u043c\u0435\u043d\u044c\u0448\u0435\u00bb. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0435 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438, \u0435\u0441\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043b\u0435\u0432\u0430 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0440\u0430\u0432\u0430. \u0418\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044f. <\/p>\n<pre><code class=\"cs\">        public static void Exchange(ref int[] array)         {             for (int i = 0; i &lt; array.Length; i++)             {                 for (int j = i; j &lt; array.Length; j++)                 {                     if (array[j] &lt; array[i])                     {                         int container = array[j];                         array[j] = array[i];                         array[i] = container;                     }                 }             }          } \/\/ Exchange<\/code><\/pre>\n<h3>10 -> 3000 Synthetic <\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6cd\/992\/745\/6cd992745218a40c7557b6e9df6c513b.PNG\" width=\"727\" height=\"342\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 3000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/db0\/4a7\/d72\/db04a7d7270c7f76704346e49abcaf2e.PNG\" width=\"729\" height=\"337\"\/><figcaption><\/figcaption><\/figure>\n<h2>Heap  <\/h2>\n<p>\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u0438\u0440\u0430\u043c\u0438\u0434\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u00a0\u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0435 \u0434\u0435\u0440\u0435\u0432\u043e. \u0421\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0435 \u0434\u0435\u0440\u0435\u0432\u043e\u00a0\u2014 \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0443\u0441\u043b\u043e\u0432\u0438\u044f:  <\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043b\u0438\u0441\u0442 \u0438\u043c\u0435\u0435\u0442 \u0433\u043b\u0443\u0431\u0438\u043d\u0443 \u043b\u0438\u0431\u043e d, \u043b\u0438\u0431\u043e\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"d-1\" alt=\"d-1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a73\/67d\/5d6\/a7367d5d67851cd7f16b736f7da3671f.svg\" width=\"43\" height=\"18\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"d\" alt=\"d\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/43f\/e1c\/4d8\/43fe1c4d8c51953c52f6fedd21c55f2e.svg\" width=\"10\" height=\"17\"\/> \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0434\u0435\u0440\u0435\u0432\u0430.  <\/p>\n<\/li>\n<li>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043b\u044e\u0431\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 (\u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u00a0\u2014 \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435) \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0435\u0451 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 .<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">        public static void Heap(ref int[] array)         {             int n = array.Length;               for (int i = n \/ 2 - 1; i >= 0; i--)                 Heapify(array, n, i);              for (int i = n - 1; i > 0; i--)             {                  int temp = array[0];                 array[0] = array[i];                 array[i] = temp;                  Heapify(array, i, 0);             }          } \/\/ Heap<\/code><\/pre>\n<h3>10 -> 10000 Synthetic<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1ee\/80a\/9a6\/1ee80a9a62e851bcf7ec94e5241a278f.PNG\" width=\"727\" height=\"342\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/371\/c7e\/6a4\/371c7e6a4158b7642c917bd45a446914.PNG\" width=\"721\" height=\"344\"\/><figcaption><\/figcaption><\/figure>\n<h2>MSDRadix  <\/h2>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u043e \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0446\u0438\u0444\u0440\u0430\u043c\u0438. \u041d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u0432 \u043b\u044e\u0431\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u0435\u043d \u0434\u043b\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043b\u044e\u0431\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u00ab\u0440\u0430\u0437\u0440\u044f\u0434\u044b\u00bb, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0441\u043b\u0430, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043d\u0430\u0431\u043e\u0440\u0430 \u0446\u0438\u0444\u0440, \u043d\u043e \u0438 \u0441\u0442\u0440\u043e\u043a\u0438, \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043d\u0430\u0431\u043e\u0440\u0430 \u0431\u0430\u0439\u0442. <\/p>\n<pre><code class=\"cs\">public static void MSDRadix(ref int[] array) => MSDRadix(array, 0, array.Length - 1, 0, new int[array.Length]); \/\/ MSDRadix private static int[] MSDRadix(int[] array, int l, int r, int d, int[] temp)         {             if (l >= r)             {                 return new int[0];             }              const int k = 256;              var count = new int[k + 2];             for (var i = l; i &lt;= r; i++)             {                 var j = Key(array[i]);                 count[j + 2]++;             }              for (var i = 1; i &lt; count.Length; i++)             {                 count[i] += count[i - 1];             }              for (var i = l; i &lt;= r; i++)             {                 var j = Key(array[i]);                 temp[count[j + 1]++] = array[i];             }              for (var i = l; i &lt;= r; i++)             {                 array[i] = temp[i - l];             }              for (var i = 0; i &lt; k; i++)             {                 MSDRadix(array, l + count[i], l + count[i + 1] - 1, d + 1, temp);             }              int Key(int s) => d >= s ? -1 : s;              return array;         }<\/code><\/pre>\n<h3>10 -> 200 Synthetic <\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/06a\/9cc\/1ff\/06a9cc1ff015ea1a93eb382c18825d87.PNG\" width=\"727\" height=\"344\"\/><figcaption><\/figcaption><\/figure>\n<h3>10 -> 100 Real<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/542\/e80\/952\/542e809525736d8309a7eb79e45f9e09.PNG\" width=\"722\" height=\"344\"\/><figcaption><\/figcaption><\/figure>\n<hr\/>\n<p>\u0414\u043b\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0438 Synthetic \u044d\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0440\u0430\u043d\u0434\u043e\u043c \u0432 c#, Real \u044d\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u0430\u043a \u043d\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0430\u044f \u043f\u0440\u044f\u043c\u0430\u044f \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0448\u0443\u043c\u0430 \u0438 \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>\u0422\u0435\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c Windows 10 \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0430\u0445 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u043d\u0430 \u0441\u0432\u043e\u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u044b.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u0443 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f <a href=\"https:\/\/github.com\/Mika-dot\/Array-sorting\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u0434<\/a>.<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0444\u0430\u043a\u0442 \u0447\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c BasicCounting  \u0432\u044b\u0448\u0435\u043b \u043a\u0443\u0434\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0447\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 C#.<\/p>\n<ul>\n<li>\n<p>\u0413\u0440\u0430\u0444\u0438\u043a \u043a\u0440\u0430\u0441\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 &#171;Array.Sort&#187;. <\/p>\n<\/li>\n<li>\n<p>\u0413\u0440\u0430\u0444\u0438\u043a \u0447\u0435\u0440\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c \u00abBasicCounting\u00bb.  <\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/827\/eab\/c6e\/827eabc6e498ae2550c4689bc51ed9af.PNG\" width=\"735\" height=\"364\"\/><figcaption><\/figcaption><\/figure>\n<p>P.s. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0448\u043a\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043a\u0430\u043a\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043e\u043a \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0435 \u0438\u0445 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438.<\/p>\n<p>P.s.s \u042d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f. \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u044c\u0442\u0435 \u0441\u0442\u0440\u043e\u0433\u0438. \u0417\u0430\u0440\u0430\u043d\u0435\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e.   <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \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\/post\/689738\/\"> https:\/\/habr.com\/ru\/post\/689738\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0434\u0430\u0432\u043d\u043e \u0447\u0438\u0442\u0430\u044e \u0425\u0430\u0431\u0440 \u0438 \u0432\u0441\u0435 \u0445\u043e\u0442\u0435\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u043b \u0441 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438 \u043e \u0447\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c. \u041d\u043e \u0440\u0435\u0448\u0438\u043b \u0447\u0442\u043e \u0442\u044f\u043d\u0443\u0442\u044c \u043a\u043e\u0442\u0430 \u0437\u0430 \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e. \u041d\u0430\u0434\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0437\u044f\u0442\u044c \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0437\u043e\u0440 \u043e \u0447\u0435\u043c \u0442\u043e \u0447\u0442\u043e \u044f \u0437\u043d\u0430\u044e \u0438 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 37 \u0448\u0442\u0443\u043a. \u042f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438, \u043e\u0434\u043d\u0430 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432.<\/p>\n<h3>\u0421\u043f\u0438\u0441\u043e\u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432<\/h3>\n<ul>\n<li>\n<p>Bubble  <\/p>\n<\/li>\n<li>\n<p>Shaker  <\/p>\n<\/li>\n<li>\n<p>Insertion  <\/p>\n<\/li>\n<li>\n<p>Stooge  <\/p>\n<\/li>\n<li>\n<p>Pancake  <\/p>\n<\/li>\n<li>\n<p>Shell  <\/p>\n<\/li>\n<li>\n<p>Merge  <\/p>\n<\/li>\n<li>\n<p>Selection  <\/p>\n<\/li>\n<li>\n<p>Quick  <\/p>\n<\/li>\n<li>\n<p>Gnome  <\/p>\n<\/li>\n<li>\n<p>Tree  <\/p>\n<\/li>\n<li>\n<p>Comb  <\/p>\n<\/li>\n<li>\n<p>BasicCounting  <\/p>\n<\/li>\n<li>\n<p>CombinedBubble  <\/p>\n<\/li>\n<li>\n<p>Heapify  <\/p>\n<\/li>\n<li>\n<p>Cocktail  <\/p>\n<\/li>\n<li>\n<p>OddEven  <\/p>\n<\/li>\n<li>\n<p>Tim  <\/p>\n<\/li>\n<li>\n<p>Counting  <\/p>\n<\/li>\n<li>\n<p>Radix  <\/p>\n<\/li>\n<li>\n<p>Bucket  <\/p>\n<\/li>\n<li>\n<p>BinaryInsertion  <\/p>\n<\/li>\n<li>\n<p>Bogo  <\/p>\n<\/li>\n<li>\n<p>Cycle<\/p>\n<\/li>\n<li>\n<p>Exchange  <\/p>\n<\/li>\n<li>\n<p>Heap  <\/p>\n<\/li>\n<li>\n<p>MSDRadix  <\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043e\u043a.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td rowspan=\"2\">\n<p align=\"left\"><strong>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<td colspan=\"3\" data-colwidth=\"0,0,131\" width=\"0\">\n<p align=\"left\"><strong>\u0412\u0440\u0435\u043c\u044f<\/strong><\/p>\n<\/td>\n<td rowspan=\"2\">\n<p align=\"left\"><strong>\u041f\u0430\u043c\u044f\u0442\u044c<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041b\u0443\u0447\u0448\u0435\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0440\u0435\u0434\u043d\u0435\u0435<\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\u0425\u0443\u0434\u0448\u0435\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Bubble  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Shaker  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Insertion  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Stooge  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Pancake  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Shell  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\u0417\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u044b\u0431\u043e\u0440\u0430 \u0448\u0430\u0433\u0430  <\/p>\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Merge  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Selection  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Quick  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Gnome  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Tree  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Comb  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">BasicCounting  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">CombinedBubble  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Heapify  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Cocktail  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">OddEven  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Tim  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Counting  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Radix  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Bucket  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">BinaryInsertion  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Bogo  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Cycle  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Exchange  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Heap  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">MSDRadix  <\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"131\" width=\"131\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432<\/h2>\n<h2>Bubble  <\/h2>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u043f\u0440\u043e\u0445\u043e\u0434\u0430\u0445 \u043f\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0443. \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0438, \u0435\u0441\u043b\u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432 \u043f\u0430\u0440\u0435 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439, \u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0435\u043d\u044f\u044e\u0442 \u043c\u0435\u0441\u0442\u0430\u043c\u0438. \u0417\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u0441\u0442\u0430\u0435\u0442 \u043d\u0430 \u0441\u0432\u043e\u0435 \u043c\u0435\u0441\u0442\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u043e\u0432, \u0433\u0434\u0435\u00a0\u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u043c, \u043d\u0430 \u0432\u0445\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u00a0.<\/p>\n<pre><code class=\"cs\">        public static void Bubble(ref int[] array) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u043c         {             var len = array.Length;             for (var i = 1; i &lt; len; i++)             {                 for (var j = 0; j &lt; len - i; j++)                 {                     if (array[j] > array[j + 1])                     {                         Swap(ref array[j], ref array[j + 1]);                     }                 }             }          }<\/code><\/pre>\n<h3>10 -> 2000 \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>10 -> 2000 \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0435<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>Shaker<\/h2>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043e\u043d \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443, \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u0430\u043c\u0438. \u041f\u0440\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0446\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0432\u044b\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0438 \u043c\u0435\u043b\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u043a\u043e\u043d\u0435\u0446 \u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.  <\/p>\n<pre><code class=\"cs\">public static void Shaker(ref int[] array) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u0435\u043c         {             for (var i = 0; i &lt; array.Length \/ 2; i++)             {                 var swapFlag = false;                 \/\/\u043f\u0440\u043e\u0445\u043e\u0434 \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e                 for (var j = i; j &lt; array.Length - i - 1; j++)                 {                     if (array[j] > array[j + 1])                     {                         Swap(ref array[j], ref array[j + 1]);                         swapFlag = true;                     }                 }                  \/\/\u043f\u0440\u043e\u0445\u043e\u0434 \u0441\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u043e                 for (var j = array.Length - 2 - i; j > i; j--)                 {                     if (array[j - 1] > array[j])                     {                         Swap(ref array[j - 1], ref array[j]);                         swapFlag = true;                     }                 }                  \/\/\u0435\u0441\u043b\u0438 \u043e\u0431\u043c\u0435\u043d\u043e\u0432 \u043d\u0435 \u0431\u044b\u043b\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u043c                 if (!swapFlag)                 {                     break;                 }             }          }<\/code><\/pre>\n<h2> 10 -> 2000 Synthetic<\/h2>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>Insertion <\/h2>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c: \u0435\u0441\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0436\u0435 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0432 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0448\u0430\u0433\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0434\u0438\u043d \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u043d\u0443\u0436\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0432 \u0443\u0436\u0435 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440 \u043f\u043e\u043a\u0430 \u0432\u0435\u0441\u044c \u043d\u0430\u0431\u043e\u0440 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d. \u041c\u0435\u0442\u043e\u0434 \u0432\u044b\u0431\u043e\u0440\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u0435\u043d, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u0431\u044b\u0447\u043d\u043e (\u0438 \u0441 \u0446\u0435\u043b\u044c\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438), \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0438\u0445 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435.  <\/p>\n<pre><code class=\"cs\">        public static void Insertion(ref int[] array) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u0441\u0442\u0430\u0432\u043a\u0430\u043c\u0438         {             int n = array.Length;             for (int i = 1; i &lt; n; ++i)             {                 int key = array[i];                 int j = i - 1;                  \/\/ Move elements of arr[0..i-1],                 \/\/ that are greater than key,                 \/\/ to one position ahead of                 \/\/ their current position                 while (j >= 0 &amp;&amp; array[j] > key)                 {                     array[j + 1] = array[j];                     j = j - 1;                 }                 array[j + 1] = key;             }         }<\/code><\/pre>\n<h3>10 -> 2000 Synthetic<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>Stooge  <\/h2>\n<p>\u00a0\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438. \u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u0440\u0430\u0439\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438  <\/p>\n<p>A\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435, \u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c 3 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u0441\u043f\u0438\u0441\u043a\u0430, \u0442\u043e:<\/p>\n<ul>\n<li>\n<p>\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c Stooge sort \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u044b\u0445 2\/3 \u0441\u043f\u0438\u0441\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c Stooge sort \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 2\/3 \u0441\u043f\u0438\u0441\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c Stooge sort \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u044b\u0445 2\/3 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u043d\u043e\u0432\u0430<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0418\u043d\u0430\u0447\u0435: return<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">        public static void Stooge(ref int[] array, int startIndex, int endIndex) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c         {             if (array[startIndex] > array[endIndex])             {                 Swap(ref array[startIndex], ref array[endIndex]);             }              if (endIndex - startIndex > 1)             {                 var len = (endIndex - startIndex + 1) \/ 3;                 Stooge(ref array, startIndex, endIndex - len);                 Stooge(ref array, startIndex + len, endIndex);                 Stooge(ref array, startIndex, endIndex - len);             }          }         public static void Stooge(ref int[] array) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c         {             Stooge(ref array, 0, array.Length - 1);         }<\/code><\/pre>\n<h3>10 -> 1000 Synthetic<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>10 -> 1000 Real<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>Pancake  <\/h2>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430\u044f \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435\u00a0\u2014 \u043f\u0435\u0440\u0435\u0432\u043e\u0440\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043e \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439, \u0432 \u0431\u043b\u0438\u043d\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0440\u043e\u0442\u043e\u0432. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u0441\u0442\u043e\u043f\u043a\u0443\u00a0\u0431\u043b\u0438\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0442\u0430\u0441\u0443\u044e\u0442 \u043f\u0443\u0442\u0451\u043c \u0432\u0437\u044f\u0442\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u043b\u0438\u043d\u043e\u0432 \u0441\u0432\u0435\u0440\u0445\u0443 \u0438 \u0438\u0445 \u043f\u0435\u0440\u0435\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f  <\/p>\n<pre><code class=\"cs\">        public static void Pancake(ref int[] array) \/\/\u0431\u043b\u0438\u043d\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430         {             for (var subArrayLength = array.Length - 1; subArrayLength >= 0; subArrayLength--)             {                 \/\/\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u0434\u043c\u0430\u0441\u0441\u0438\u0432\u0430                 var indexOfMax = IndexOfMax(array, subArrayLength);                 if (indexOfMax != subArrayLength)                 {                     \/\/\u043f\u0435\u0440\u0435\u0432\u043e\u0440\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430                     \/\/\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0441\u044f \u0432\u043d\u0430\u0447\u0430\u043b\u0435                     Flip(array, indexOfMax);                     \/\/\u043f\u0435\u0440\u0435\u0432\u043e\u0440\u043e\u0442 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u043c\u0430\u0441\u0441\u0438\u0432\u0430                     Flip(array, subArrayLength);                 }             }          }<\/code><\/pre>\n<h3>10 -> 2000 Synthetic<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>10 -> 2000 Real<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>Shell  <\/h2>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434 \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c\u00a0, \u0442\u0430\u043a\u0438\u043c, \u0447\u0442\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043e\u0442\u0441\u0442\u0430\u044e\u0449\u0438\u0435 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u043d\u0430\u00a0\u043f\u043e\u0437\u0438\u0446\u0438\u0439. \u0428\u0435\u043b\u043b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f, \u043d\u043e\u00a0\u0432\u0441\u0435\u0433\u0434\u0430.<\/p>\n<ul>\n<li>\n<p>\u041d\u0430\u0447\u0430\u043b\u043e.<\/p>\n<\/li>\n<li>\n<p><strong>\u0428\u0430\u0433 0.<\/strong> .<\/p>\n<\/li>\n<li>\n<p><strong>\u0428\u0430\u0433 1.<\/strong>\u00a0\u0420\u0430\u0437\u043e\u0431\u044c\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043e\u0442\u0441\u0442\u0430\u044e\u0449\u0438\u0445 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u043d\u0430\u00a0\u0422\u0430\u043a\u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0431\u0443\u0434\u0435\u0442\u00a0<\/p>\n<\/li>\n<li>\n<p><strong>\u0428\u0430\u0433 2.<\/strong>\u00a0\u041e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430\u00a0\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0428\u0430\u0433 3.<\/strong>\u00a0\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043c \u0441\u043f\u0438\u0441\u043a\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043c\u0430\u0441\u0441\u0438\u0432. \u0423\u043c\u0435\u043d\u044c\u0448\u0438\u043c\u00a0. \u0415\u0441\u043b\u0438\u00a0\u043d\u0435\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u00a0  \u2014 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u0448\u0430\u0433\u0443 1<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0435\u0446.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">        public static void Shell(ref int[] array) \/\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0428\u0435\u043b\u043b\u0430         {             \/\/\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f             var d = array.Length \/ 2;             while (d >= 1)             {                 for (var i = d; i &lt; array.Length; i++)                 {                     var j = i;                     while ((j >= d) &amp;&amp; (array[j - d] > array[j]))                     {                         Swap(ref array[j], ref array[j - d]);                         j = j - d;                     }                 }                  d = d \/ 2;             }          }<\/code><\/pre>\n<h3>10 -> 10000 Synthetic<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>10 -> 10000 Real<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>Merge  <\/h2>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u00ab\u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0439 \u0438 \u0432\u043b\u0430\u0441\u0442\u0432\u0443\u0439\u00bb: \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0434\u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043b\u0438\u044f\u043d\u0438\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<ol>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0442\u043e \u043e\u043d \u0443\u0436\u0435 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u2014 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0430\u0447\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043a \u043d\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441\u043b\u0438\u044f\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e \u0434\u0432\u0443\u043c \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0447\u0430\u0441\u0442\u044f\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">        private static void merge(int[] arr, int l, int m, int r)         {             \/\/ original array is broken in two parts               \/\/ left and right array               int len1 = m - l + 1, len2 = r - m;             int[] left = new int[len1];             int[] right = new int[len2];              for (int x = 0; x &lt; len1; x++)                 left[x] = arr[l + x];              for (int x = 0; x &lt; len2; x++)                 right[x] = arr[m + 1 + x];              int i = 0;             int j = 0;             int k = l;              \/\/ after comparing, we merge those two array               \/\/ in larger sub array               while (i &lt; len1 &amp;&amp; j &lt; len2)             {                 if (left[i] &lt;= right[j])                 {                     arr[k] = left[i];                     i++;                 }                 else                 {                     arr[k] = right[j];                     j++;                 }                 k++;             }              \/\/ copy remaining elements of left, if any               while (i &lt; len1)       <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-338657","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/338657","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=338657"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/338657\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=338657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=338657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=338657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}