{"id":397453,"date":"2024-06-29T13:27:25","date_gmt":"2024-06-29T13:27:25","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=397453"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=397453","title":{"rendered":"<span>\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Java<\/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<p>\u041a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u0432\u0430\u0436\u043d\u043e \u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0438 \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0434 \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u0441\u0432\u043e\u0435\u0439 \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Java.<\/p>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d\u0438 \u0438 \u043a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u0432 Java?<\/h3>\n<p>\u041f\u043e\u0434 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0438\u0445 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u0412 Java \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p>\u041c\u0430\u0441\u0441\u0438\u0432<\/p>\n<\/li>\n<li>\n<p>\u0421\u043f\u0438\u0441\u043e\u043a (\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432)<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0435\u043a<\/p>\n<\/li>\n<li>\n<p>\u041e\u0447\u0435\u0440\u0435\u0434\u044c<\/p>\n<\/li>\n<li>\n<p>\u0421\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>HashTable \u0438 HashMap<\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u0440\u0435\u0432\u043e <\/p>\n<\/li>\n<\/ul>\n<h3>\u041c\u0430\u0441\u0441\u0438\u0432<\/h3>\n<p>\u041c\u0430\u0441\u0441\u0438\u0432 &#8212; \u044d\u0442\u043e \u043d\u0443\u043c\u0435\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430. <\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">int[] arr = new int[10];<\/code><\/pre>\n<ul>\n<li>\n<p>\u0412\u0441\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0432 Java \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0435. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043c\u0435\u0442\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 new \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0441\u044b\u043b\u043a\u0430 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0435\u043a\u0435, \u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043a\u0443\u0447\u0435. \u0415\u0441\u043b\u0438 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0435\u0442 \u0441\u0441\u044b\u043b\u043e\u043a, \u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0451\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u043e \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439<\/p>\n<\/li>\n<\/ul>\n<h3>\u0421\u043f\u0438\u0441\u043e\u043a (\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432)<\/h3>\n<p>\u0418\u0434\u0435\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u043b\u0438 \u0436\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 <abbr class=\"habraabbr\" title=\"\u0415\u043c\u043a\u043e\u0441\u0442\u044c - \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0420\u0430\u0437\u043c\u0435\u0440 - \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.\" data-title=\"&lt;p>\u0415\u043c\u043a\u043e\u0441\u0442\u044c &#8212; \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.&lt;\/p>&lt;p>\u0420\u0430\u0437\u043c\u0435\u0440 &#8212; \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.&lt;\/p>&#187; data-abbr=&#187;\u0435\u043c\u043a\u043e\u0441\u0442\u0438&#187;>\u0435\u043c\u043a\u043e\u0441\u0442\u0438<\/abbr>. <\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">ArrayList&lt;Integer> arr = new ArrayList&lt;Integer>();<\/code><\/pre>\n<ul>\n<li>\n<p>\u041f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u043e\u0431\u0435\u0440\u0442\u043a\u0443. \u041e \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u043e\u0431\u0435\u0440\u0442\u043a\u0430\u0445, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/docs.oracle.com\/javase\/tutorial\/java\/data\/autoboxing.html#:~:text=Autoboxing%20is%20the%20automatic%20conversion,way%2C%20this%20is%20called%20unboxing.\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e ArrayList, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c Object \u0438 \u0442\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0449\u0435 \u0438 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u044b \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0430\u0432\u0442\u043e\u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0435<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0435\u043c\u043a\u043e\u0441\u0442\u044c, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u0435\u043c\u043a\u043e\u0441\u0442\u044c\u044e \u0432 10 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0435\u043c\u043a\u043e\u0441\u0442\u0438 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0435\u043c\u043a\u043e\u0441\u0442\u044c\u044e: \u043d\u043e\u0432\u0430\u044f_\u0435\u043c\u043a\u043e\u0441\u0442\u044c = (\u0441\u0442\u0430\u0440\u0430\u044f_\u0435\u043c\u043a\u043e\u0441\u0442\u044c * 3) \/ 2 + 1. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u043f\u0438\u0441\u043a\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0430\u043f\u0440\u0430\u0441\u043d\u043e, \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 trimToSize()<\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u041f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b<\/summary>\n<div class=\"spoiler__content\">\n<p>+ \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u0437\u0430 O(1), \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0437\u0430 O(n);<br \/>+ \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u0436\u0435 null.<\/p>\n<p>&#8212; \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044c \u0432\u0441\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0437\u0430 O(n);<br \/>&#8212; \u043f\u043e\u0438\u0441\u043a \u0437\u0430 O(n);<br \/>&#8212; \u043d\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d.<\/p>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u0421\u0442\u0435\u043a<\/h3>\n<p>\u041e\u0447\u0435\u0440\u0435\u0434\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 LIFO. \u0412 Java \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 Vector&lt;E>, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b: Iterable&lt;E>, Collection&lt;E>, List&lt;E>, RandomAccess, Serializable, Cloneable. <\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">Stack&lt;Integer> arr = new Stack&lt;Integer>();<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>push() &#8212; \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u043a\u043e\u043d\u0435\u0446 \u043e\u0447\u0435\u0440\u0435\u0434\u0438;<\/p>\n<\/li>\n<li>\n<p>peek() &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438 <em>\u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 <\/em>\u0435\u0433\u043e;<\/p>\n<\/li>\n<li>\n<p>pop() &#8212;  <em>\u0443\u0434\u0430\u043b\u044f\u0435\u0442<\/em> \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0435\u0433\u043e;<\/p>\n<\/li>\n<li>\n<p>empty() &#8212; \u0432\u0435\u0440\u043d\u0435\u0442 true &#8212; \u0435\u0441\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u0443\u0441\u0442\u0430 \u0438 false &#8212; \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435;<\/p>\n<\/li>\n<li>\n<p>search() &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>\u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0437\u0438\u0446\u0438\u0438<\/em> \u0441 \u043a\u043e\u043d\u0446\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h3>\u041e\u0447\u0435\u0440\u0435\u0434\u044c<\/h3>\n<p>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Queue&lt;E> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 <abbr class=\"habraabbr\" title=\"\u041f\u0440\u0438\u043d\u0446\u0438\u043f FIFO (\u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0440\u0438\u0448\u0435\u043b, \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u044b\u0448\u0435\u043b).\" data-title=\"&lt;p>\u041f\u0440\u0438\u043d\u0446\u0438\u043f FIFO (\u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0440\u0438\u0448\u0435\u043b, \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u044b\u0448\u0435\u043b).&lt;\/p>&#187; data-abbr=&#187;\u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e&#187;>\u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e<\/abbr> \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0430 Deque&lt;E> &#8212; <abbr class=\"habraabbr\" title=\"\u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b FIFO \u0438 LIFO (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043f\u0440\u0438\u0448\u0435\u043b, \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u044b\u0448\u0435\u043b)\" data-title=\"&lt;p>\u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b FIFO \u0438 LIFO (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043f\u0440\u0438\u0448\u0435\u043b, \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u044b\u0448\u0435\u043b)&lt;\/p>&#187; data-abbr=&#187;\u0434\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e&#187;>\u0434\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e<\/abbr>. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044e \u0432 Java, \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u0418\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f:<\/p>\n<ul>\n<li>\n<p>Iterable&lt;T> => Collection&lt;E> => Queue&lt;E> => Deque&lt;E><\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b Queue&lt;E> \u0438 Deque&lt;E> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>ArrayDeque&lt;E> &#8212; \u0434\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044f\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u044c<\/p>\n<\/li>\n<li>\n<p>LinkedList&lt;E> &#8212; \u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>PriorityQueue&lt;E> &#8212; \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">Queue&lt;Integer> arr = new ArrayDeque&lt;Integer>(); Deque&lt;Integer> arr1 = new ArrayDeque&lt;Integer>(); PriorityQueue&lt;Integer> arr2 = new PriorityQueue&lt;Integer>(); \/\/ \u041e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430 LinkedList'\u0435 Queue&lt;Integer> arr = new LinkedList&lt;Integer>(); Deque&lt;Integer> arr = new LinkedList&lt;Integer>();<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0430 \u043b\u0438\u0441\u0442\u0435 \u0438 \u0434\u0435\u043a\u0443<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>ArrayDeque \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0434\u0435\u043a \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c LinkedList<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p>\u041f\u0430\u0440\u0443 \u0441\u043b\u043e\u0432 \u043e PriorityQueue.<br \/>\u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b: Iterable&lt;E>, Collection&lt;E>, Queue&lt;E>, Serializable. \u0423 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438: <\/p>\n<ul>\n<li>\n<p>\u0418\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 null \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f<\/p>\n<\/li>\n<\/ul>\n<h3>\u0421\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a<\/h3>\n<p>LinkedList&lt;E> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 <abbr class=\"habraabbr\" title=\"\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0443\u0437\u043b\u043e\u0432. \u0423\u0437\u043b\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439, \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0443\u0437\u0435\u043b \u0441\u043f\u0438\u0441\u043a\u0430.\" data-title=\"&lt;p>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0443\u0437\u043b\u043e\u0432. \u0423\u0437\u043b\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439, \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0443\u0437\u0435\u043b \u0441\u043f\u0438\u0441\u043a\u0430.&lt;\/p>&lt;p>&lt;\/p>&#187; data-abbr=&#187;\u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a&#187;>\u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a<\/abbr>, \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u044f\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b.<\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b:<br \/>Iterable&lt;E>, Collection&lt;E>, List&lt;E>, Queue&lt;E>, Deque&lt;E>, Serializable, Cloneable.<\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">LinkedList&lt;Integer> arr = new LinkedList&lt;Integer>();<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 ArrayList \u0438 LinkedList \u043f\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f<\/p>\n<\/td>\n<td>\n<p align=\"center\">ArrayList<\/p>\n<\/td>\n<td>\n<p align=\"center\">LinkedList<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">add (E element)<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(1)<br \/>O(n) &#8212; \u043f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(1)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">add (int index, E element)<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(n\/2) &#8212; \u0441 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u044b<br \/>O(n) &#8212; \u0441 \u043d\u0430\u0447\u0430\u043b\u0430<br \/>O(1) &#8212; \u0441 \u043a\u043e\u043d\u0446\u0430<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(n\/4)<br \/>O(n) &#8212; \u0432 \u043a\u043e\u043d\u0435\u0446 \u0438\u043b\u0438 \u043d\u0430\u0447\u0430\u043b\u043e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">remove (int index)<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(n\/2) &#8212; \u0441 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u044b<br \/>O(n) &#8212; \u0441 \u043d\u0430\u0447\u0430\u043b\u0430<br \/>O(1) &#8212; \u0441 \u043a\u043e\u043d\u0446\u0430<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(n\/4)<br \/>O(n) &#8212; \u0432 \u043a\u043e\u043d\u0435\u0446 \u0438\u043b\u0438 \u043d\u0430\u0447\u0430\u043b\u043e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">get (int index)<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(1)<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(n\/4)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>LinkedList \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0435\u043c ArrayList. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043a\u043e\u0433\u0434\u0430 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0434\u0432\u0443\u0441\u0432\u044f\u0437\u043d\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435. \u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0443 ArrayList \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 O(1)<\/p>\n<\/div>\n<\/details>\n<h3>HashTable \u0438 HashMap<\/h3>\n<p>HashTable \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u043b\u0438\u0448\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u043c\u0430\u043f\u043e\u0439 \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439. HashMap \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u044b \u00ab\u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u00bb. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0445\u044d\u0448-\u043c\u0430\u043f\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043f\u0430\u0446\u0438\u0435\u043d\u0442\u0430 \u0431\u043e\u043b\u044c\u043d\u0438\u0446\u044b, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0424.\u0418.\u041e.<strong> <\/strong>\u0438 \u043d\u043e\u043c\u0435\u0440 \u043c\u0435\u0434\u0438\u0446\u0438\u043d\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u0438\u0441\u0430.<\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0443 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u0435\u043c\u043a\u043e\u0441\u0442\u044c\u044e \u0432 16 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u043c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f 0.75<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430, \u0442\u043e \u0447\u0438\u0441\u043b\u043e <abbr class=\"habraabbr\" title=\"\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432\" data-title=\"&lt;p>\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432  &lt;\/p>&#187; data-abbr=&#187;bucket&#187;>bucket<\/abbr>&#8216;\u043e\u0432 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430  <\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043b\u0430\u0441\u0441 HashMap&lt;K, V> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b: <br \/>Map&lt;K, V>, Serializable, Cloneable.<\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">HashMap&lt;String, Integer> map = new HashMap&lt;String, Integer>();<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 HashTable \u0438 HashMap<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>\u0425\u044d\u0448-\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c null, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u0425\u044d\u0448-\u041c\u0430\u043f\u044b<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0425\u044d\u0448-\u0422\u0430\u0431\u043b\u0438\u0446\u0435 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0447\u0442\u043e \u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u0425\u044d\u0448-\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0435\u0439, \u0425\u044d\u0448-\u041c\u0430\u043f\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435<\/p>\n<p>P.S. \u0415\u0441\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0441 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c\u0438, \u0442\u043e \u0435\u0441\u0442\u044c ConcurrentHashMap<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h3>\u0414\u0435\u0440\u0435\u0432\u043e<\/h3>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 Java \u043d\u0435\u0442, \u043d\u043e \u0435\u0441\u0442\u044c TreeMap&lt;K, V> \u0438 TreeSet&lt;E>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0441\u043b\u043e\u0432\u0430\u0440\u0438, \u0433\u0434\u0435 \u043a\u043b\u044e\u0447\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. TreeSet \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 TreeMap, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u043a\u0440\u0430\u0441\u043d\u043e-\u0447\u0435\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 TreeSet&lt;E> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b: <br \/>Itearble&lt;E>, Collection&lt;E>, Set&lt;E>, SortedSet&lt;E>, NavigatbleSet&lt;E>, Serializable, Cloneable.<\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 TreeMap&lt;K, V> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b: <br \/>Map&lt;K,V>, SortedMap&lt;K, V>, NavigatbleMap&lt;K, V>, Serializable, Cloneable.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>\u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c; <\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043d\u0438\u0436\u043d\u0438\u0445 \u0443\u0440\u043e\u0432\u043d\u0435\u0439; <\/p>\n<\/li>\n<li>\n<p>\u0441\u043a\u043b\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u043a \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.  <\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">TreeSet&lt;Integer> set = new TreeSet&lt;Integer>(); TreeMap&lt;String, Integer> map = new TreeMap&lt;String, Integer>();<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0412 \u0447\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 HashSet \u0438 TreeSet<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>\u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0443 TreeSet \u043b\u0435\u0436\u0438\u0442 \u043a\u0440\u0430\u0441\u043d\u043e-\u0447\u0435\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u043a\u0440\u0430\u0441\u043d\u043e-\u0447\u0435\u0440\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432. HashSet \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c TreeSet &#8212; O(log(n)), HashSet &#8212; O(1) (\u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u043c\u0435\u0442\u043e\u0434\u0430\u0445 add(), contains(), remove())<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u0441\u0432\u043e\u0435\u0439 \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u0431\u044b\u0432\u0430\u044e. \u0411\u0443\u0434\u0435\u0442 \u043a\u0440\u0443\u0442\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f, \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0436\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Java, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0430\u043c \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0438 \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u043e\u0441\u0432\u0435\u0436\u0438\u0442\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0437\u043d\u0430\u043d\u0438\u044f.<\/p>\n<p> \u0416\u0435\u043b\u0430\u044e \u0432\u0430\u043c \u0443\u0441\u043f\u0435\u0445\u043e\u0432 \u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u043a \u043c\u043e\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438!<\/p>\n<p><a href=\"https:\/\/docs.oracle.com\/javase\/tutorial\/\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/751648\/\"> https:\/\/habr.com\/ru\/articles\/751648\/<\/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<p>\u041a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u0432\u0430\u0436\u043d\u043e \u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0438 \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0434 \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u0441\u0432\u043e\u0435\u0439 \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Java.<\/p>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d\u0438 \u0438 \u043a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u0432 Java?<\/h3>\n<p>\u041f\u043e\u0434 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0438\u0445 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u0412 Java \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p>\u041c\u0430\u0441\u0441\u0438\u0432<\/p>\n<\/li>\n<li>\n<p>\u0421\u043f\u0438\u0441\u043e\u043a (\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432)<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0435\u043a<\/p>\n<\/li>\n<li>\n<p>\u041e\u0447\u0435\u0440\u0435\u0434\u044c<\/p>\n<\/li>\n<li>\n<p>\u0421\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>HashTable \u0438 HashMap<\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u0440\u0435\u0432\u043e <\/p>\n<\/li>\n<\/ul>\n<h3>\u041c\u0430\u0441\u0441\u0438\u0432<\/h3>\n<p>\u041c\u0430\u0441\u0441\u0438\u0432 &#8212; \u044d\u0442\u043e \u043d\u0443\u043c\u0435\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430. <\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">int[] arr = new int[10];<\/code><\/pre>\n<ul>\n<li>\n<p>\u0412\u0441\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0432 Java \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0435. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043c\u0435\u0442\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 new \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0441\u044b\u043b\u043a\u0430 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0435\u043a\u0435, \u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043a\u0443\u0447\u0435. \u0415\u0441\u043b\u0438 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0435\u0442 \u0441\u0441\u044b\u043b\u043e\u043a, \u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0451\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u043e \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439<\/p>\n<\/li>\n<\/ul>\n<h3>\u0421\u043f\u0438\u0441\u043e\u043a (\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432)<\/h3>\n<p>\u0418\u0434\u0435\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u043b\u0438 \u0436\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 <abbr class=\"habraabbr\" title=\"\u0415\u043c\u043a\u043e\u0441\u0442\u044c - \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0420\u0430\u0437\u043c\u0435\u0440 - \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.\" data-title=\"&lt;p>\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.&#187; data-title=&lt;p>\u0415\u043c\u043a\u043e\u0441\u0442\u044c &#8212; \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.&lt;\/p>&lt;p>\u0420\u0430\u0437\u043c\u0435\u0440 &#8212; \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.&lt;\/p>&#187; data-abbr=&#187;\u0435\u043c\u043a\u043e\u0441\u0442\u0438&#187;>\u0435\u043c\u043a\u043e\u0441\u0442\u0438<\/abbr>. <\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">ArrayList&lt;Integer> arr = new ArrayList&lt;Integer>();<\/code><\/pre>\n<ul>\n<li>\n<p>\u041f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u043e\u0431\u0435\u0440\u0442\u043a\u0443. \u041e \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u043e\u0431\u0435\u0440\u0442\u043a\u0430\u0445, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/docs.oracle.com\/javase\/tutorial\/java\/data\/autoboxing.html#:~:text=Autoboxing%20is%20the%20automatic%20conversion,way%2C%20this%20is%20called%20unboxing.\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e ArrayList, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c Object \u0438 \u0442\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0449\u0435 \u0438 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u044b \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0430\u0432\u0442\u043e\u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0435<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0435\u043c\u043a\u043e\u0441\u0442\u044c, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u0435\u043c\u043a\u043e\u0441\u0442\u044c\u044e \u0432 10 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0435\u043c\u043a\u043e\u0441\u0442\u0438 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0435\u043c\u043a\u043e\u0441\u0442\u044c\u044e: \u043d\u043e\u0432\u0430\u044f_\u0435\u043c\u043a\u043e\u0441\u0442\u044c = (\u0441\u0442\u0430\u0440\u0430\u044f_\u0435\u043c\u043a\u043e\u0441\u0442\u044c * 3) \/ 2 + 1. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u043f\u0438\u0441\u043a\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0430\u043f\u0440\u0430\u0441\u043d\u043e, \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 trimToSize()<\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u041f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b<\/summary>\n<div class=\"spoiler__content\">\n<p>+ \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u0437\u0430 O(1), \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0437\u0430 O(n);<br \/>+ \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u0436\u0435 null.<\/p>\n<p>&#8212; \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044c \u0432\u0441\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0437\u0430 O(n);<br \/>&#8212; \u043f\u043e\u0438\u0441\u043a \u0437\u0430 O(n);<br \/>&#8212; \u043d\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d.<\/p>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u0421\u0442\u0435\u043a<\/h3>\n<p>\u041e\u0447\u0435\u0440\u0435\u0434\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 LIFO. \u0412 Java \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 Vector&lt;E>, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b: Iterable&lt;E>, Collection&lt;E>, List&lt;E>, RandomAccess, Serializable, Cloneable. <\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">Stack&lt;Integer> arr = new Stack&lt;Integer>();<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>push() &#8212; \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u043a\u043e\u043d\u0435\u0446 \u043e\u0447\u0435\u0440\u0435\u0434\u0438;<\/p>\n<\/li>\n<li>\n<p>peek() &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438 <em>\u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 <\/em>\u0435\u0433\u043e;<\/p>\n<\/li>\n<li>\n<p>pop() &#8212;  <em>\u0443\u0434\u0430\u043b\u044f\u0435\u0442<\/em> \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0435\u0433\u043e;<\/p>\n<\/li>\n<li>\n<p>empty() &#8212; \u0432\u0435\u0440\u043d\u0435\u0442 true &#8212; \u0435\u0441\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u0443\u0441\u0442\u0430 \u0438 false &#8212; \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435;<\/p>\n<\/li>\n<li>\n<p>search() &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>\u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0437\u0438\u0446\u0438\u0438<\/em> \u0441 \u043a\u043e\u043d\u0446\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h3>\u041e\u0447\u0435\u0440\u0435\u0434\u044c<\/h3>\n<p>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Queue&lt;E> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 <abbr class=\"habraabbr\" title=\"\u041f\u0440\u0438\u043d\u0446\u0438\u043f FIFO (\u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0440\u0438\u0448\u0435\u043b, \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u044b\u0448\u0435\u043b).\" data-title=\"&lt;p>\u044b\u0448\u0435\u043b).&#187; data-title=&#187;&lt;p>\u041f\u0440\u0438\u043d\u0446\u0438\u043f FIFO (\u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0440\u0438\u0448\u0435\u043b, \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u044b\u0448\u0435\u043b).&lt;\/p>&#187; data-abbr=&#187;\u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e&#187;>\u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e<\/abbr> \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0430 Deque&lt;E> &#8212; <abbr class=\"habraabbr\" title=\"\u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b FIFO \u0438 LIFO (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043f\u0440\u0438\u0448\u0435\u043b, \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u044b\u0448\u0435\u043b)\" data-title=\"&lt;p>\u044b\u043c \u0432\u044b\u0448\u0435\u043b)&#187; data-title=&lt;p>\u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b FIFO \u0438 LIFO (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043f\u0440\u0438\u0448\u0435\u043b, \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u044b\u0448\u0435\u043b)&lt;\/p>&#187; data-abbr=&#187;\u0434\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e&#187;>\u0434\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e<\/abbr>. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044e \u0432 Java, \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u0418\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f:<\/p>\n<ul>\n<li>\n<p>Iterable&lt;T> => Collection&lt;E> => Queue&lt;E> => Deque&lt;E><\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b Queue&lt;E> \u0438 Deque&lt;E> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>ArrayDeque&lt;E> &#8212; \u0434\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044f\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u044c<\/p>\n<\/li>\n<li>\n<p>LinkedList&lt;E> &#8212; \u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>PriorityQueue&lt;E> &#8212; \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">Queue&lt;Integer> arr = new ArrayDeque&lt;Integer>(); Deque&lt;Integer> arr1 = new ArrayDeque&lt;Integer>(); PriorityQueue&lt;Integer> arr2 = new PriorityQueue&lt;Integer>(); \/\/ \u041e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430 LinkedList'\u0435 Queue&lt;Integer> arr = new LinkedList&lt;Integer>(); Deque&lt;Integer> arr = new LinkedList&lt;Integer>();<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0430 \u043b\u0438\u0441\u0442\u0435 \u0438 \u0434\u0435\u043a\u0443<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>ArrayDeque \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0434\u0435\u043a \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c LinkedList<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p>\u041f\u0430\u0440\u0443 \u0441\u043b\u043e\u0432 \u043e PriorityQueue.<br \/>\u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b: Iterable&lt;E>, Collection&lt;E>, Queue&lt;E>, Serializable. \u0423 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438: <\/p>\n<ul>\n<li>\n<p>\u0418\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 null \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f<\/p>\n<\/li>\n<\/ul>\n<h3>\u0421\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a<\/h3>\n<p>LinkedList&lt;E> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 <abbr class=\"habraabbr\" title=\"\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0443\u0437\u043b\u043e\u0432. \u0423\u0437\u043b\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439, \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0443\u0437\u0435\u043b \u0441\u043f\u0438\u0441\u043a\u0430.\" data-title=\"&lt;p>\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439, \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0443\u0437\u0435\u043b \u0441\u043f\u0438\u0441\u043a\u0430.&#187; data-title=&#187;&lt;p>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0443\u0437\u043b\u043e\u0432. \u0423\u0437\u043b\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439, \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0443\u0437\u0435\u043b \u0441\u043f\u0438\u0441\u043a\u0430.&lt;\/p>&lt;p>&lt;\/p>&#187; data-abbr=&#187;\u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a&#187;>\u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a<\/abbr>, \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u044f\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b.<\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b:<br \/>Iterable&lt;E>, Collection&lt;E>, List&lt;E>, Queue&lt;E>, Deque&lt;E>, Serializable, Cloneable.<\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">LinkedList&lt;Integer> arr = new LinkedList&lt;Integer>();<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 ArrayList \u0438 LinkedList \u043f\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f<\/p>\n<\/td>\n<td>\n<p align=\"center\">ArrayList<\/p>\n<\/td>\n<td>\n<p align=\"center\">LinkedList<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">add (E element)<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(1)<br \/>O(n) &#8212; \u043f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(1)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">add (int index, E element)<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(n\/2) &#8212; \u0441 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u044b<br \/>O(n) &#8212; \u0441 \u043d\u0430\u0447\u0430\u043b\u0430<br \/>O(1) &#8212; \u0441 \u043a\u043e\u043d\u0446\u0430<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(n\/4)<br \/>O(n) &#8212; \u0432 \u043a\u043e\u043d\u0435\u0446 \u0438\u043b\u0438 \u043d\u0430\u0447\u0430\u043b\u043e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">remove (int index)<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(n\/2) &#8212; \u0441 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u044b<br \/>O(n) &#8212; \u0441 \u043d\u0430\u0447\u0430\u043b\u0430<br \/>O(1) &#8212; \u0441 \u043a\u043e\u043d\u0446\u0430<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(n\/4)<br \/>O(n) &#8212; \u0432 \u043a\u043e\u043d\u0435\u0446 \u0438\u043b\u0438 \u043d\u0430\u0447\u0430\u043b\u043e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">get (int index)<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(1)<\/p>\n<\/td>\n<td>\n<p align=\"center\">O(n\/4)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>LinkedList \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0435\u043c ArrayList. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043a\u043e\u0433\u0434\u0430 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0434\u0432\u0443\u0441\u0432\u044f\u0437\u043d\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435. \u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0443 ArrayList \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 O(1)<\/p>\n<\/div>\n<\/details>\n<h3>HashTable \u0438 HashMap<\/h3>\n<p>HashTable \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u043b\u0438\u0448\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u043c\u0430\u043f\u043e\u0439 \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439. HashMap \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u044b \u00ab\u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u00bb. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0445\u044d\u0448-\u043c\u0430\u043f\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043f\u0430\u0446\u0438\u0435\u043d\u0442\u0430 \u0431\u043e\u043b\u044c\u043d\u0438\u0446\u044b, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0424.\u0418.\u041e.<strong> <\/strong>\u0438 \u043d\u043e\u043c\u0435\u0440 \u043c\u0435\u0434\u0438\u0446\u0438\u043d\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u0438\u0441\u0430.<\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0443 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u0435\u043c\u043a\u043e\u0441\u0442\u044c\u044e \u0432 16 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u043c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f 0.75<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430, \u0442\u043e \u0447\u0438\u0441\u043b\u043e <abbr class=\"habraabbr\" title=\"\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432\" data-title=\"&lt;p>\u0441\u043f\u0438\u0441\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432&#187; data-title=&#187;&lt;p>\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432  &lt;\/p>&#187; data-abbr=&#187;bucket&#187;>bucket<\/abbr>&#8216;\u043e\u0432 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430  <\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043b\u0430\u0441\u0441 HashMap&lt;K, V> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b: <br \/>Map&lt;K, V>, Serializable, Cloneable.<\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">HashMap&lt;String, Integer> map = new HashMap&lt;String, Integer>();<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 HashTable \u0438 HashMap<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>\u0425\u044d\u0448-\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c null, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u0425\u044d\u0448-\u041c\u0430\u043f\u044b<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0425\u044d\u0448-\u0422\u0430\u0431\u043b\u0438\u0446\u0435 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0447\u0442\u043e \u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u0425\u044d\u0448-\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0435\u0439, \u0425\u044d\u0448-\u041c\u0430\u043f\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435<\/p>\n<p>P.S. \u0415\u0441\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0441 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c\u0438, \u0442\u043e \u0435\u0441\u0442\u044c ConcurrentHashMap<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h3>\u0414\u0435\u0440\u0435\u0432\u043e<\/h3>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 Java \u043d\u0435\u0442, \u043d\u043e \u0435\u0441\u0442\u044c TreeMap&lt;K, V> \u0438 TreeSet&lt;E>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0441\u043b\u043e\u0432\u0430\u0440\u0438, \u0433\u0434\u0435 \u043a\u043b\u044e\u0447\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. TreeSet \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 TreeMap, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u043a\u0440\u0430\u0441\u043d\u043e-\u0447\u0435\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 TreeSet&lt;E> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b: <br \/>Itearble&lt;E>, Collection&lt;E>, Set&lt;E>, SortedSet&lt;E>, NavigatbleSet&lt;E>, Serializable, Cloneable.<\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 TreeMap&lt;K, V> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b: <br \/>Map&lt;K,V>, SortedMap&lt;K, V>, NavigatbleMap&lt;K, V>, Serializable, Cloneable.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>\u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c; <\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043d\u0438\u0436\u043d\u0438\u0445 \u0443\u0440\u043e\u0432\u043d\u0435\u0439; <\/p>\n<\/li>\n<li>\n<p>\u0441\u043a\u043b\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u043a \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.  <\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">TreeSet&lt;Integer> set = new TreeSet&lt;Integer>(); TreeMap&lt;String, Integer> map = new TreeMap&lt;String, Integer>();<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0412 \u0447\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 HashSet \u0438 TreeSet<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>\u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0443 TreeSet \u043b\u0435\u0436\u0438\u0442 \u043a\u0440\u0430\u0441\u043d\u043e-\u0447\u0435\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u043a\u0440\u0430\u0441\u043d\u043e-\u0447\u0435\u0440\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432. HashSet \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c TreeSet &#8212; O(log(n)), HashSet &#8212; O(1) (\u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u043c\u0435\u0442\u043e\u0434\u0430\u0445 add(), contains(), remove())<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u0441\u0432\u043e\u0435\u0439 \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u0431\u044b\u0432\u0430\u044e. \u0411\u0443\u0434\u0435\u0442 \u043a\u0440\u0443\u0442\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f, \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0436\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Java, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0430\u043c \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0438 \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u043e\u0441\u0432\u0435\u0436\u0438\u0442\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0437\u043d\u0430\u043d\u0438\u044f.<\/p>\n<p> \u0416\u0435\u043b\u0430\u044e \u0432\u0430\u043c \u0443\u0441\u043f\u0435\u0445\u043e\u0432 \u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u043a \u043c\u043e\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438!<\/p>\n<p><a href=\"https:\/\/docs.oracle.com\/javase\/tutorial\/\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/751648\/\"> https:\/\/habr.com\/ru\/articles\/751648\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-397453","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/397453","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=397453"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/397453\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=397453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=397453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=397453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}