{"id":584,"date":"2018-10-25T19:54:40","date_gmt":"2018-10-25T19:54:40","guid":{"rendered":"https:\/\/yazilimperver.net\/?p=584"},"modified":"2022-01-08T20:30:35","modified_gmt":"2022-01-08T20:30:35","slug":"haftalik-c-2-konteynerler-ve-sirali-tutma","status":"publish","type":"post","link":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/","title":{"rendered":"[:tr]Haftal\u0131k C++ 2 &#8211; Konteynerler ve s\u0131ral\u0131 tutma [:en]Weekly C++ 2 &#8211; Containers and keeping sorted [:]"},"content":{"rendered":"<p>[:tr]Merhaba arkada\u015flar,<\/p>\n<p>Haftal\u0131k C++ kod \u00f6rneklerimize devam ediyoruz. Bu haftaki problemimiz <em>std::vector<\/em> gibi konteynerlere (nedir arkada\u015f bu STL konteyner sevdas\u0131 yahu \ud83d\ude42 duyar gibiyim) bir yandan veri eklerken bir yandan da bunlar\u0131 s\u0131ral\u0131 tutabilir miyiz?<\/p>\n<p>Bu probleme ge\u00e7meden \u00f6nce konteyner konusuna ufak bir e\u011filelim, \u00e7\u00fcnk\u00fc buradaki problemi \u00e7\u00f6zerken bir miktar de\u011finmemiz gerekecek. Bu s\u0131n\u0131flar\u0131n detaylar\u0131na girmeyece\u011fim ama merak edenler <span style=\"color: #339966;\"><strong><a style=\"color: #339966;\" href=\"http:\/\/www.cplusplus.com\/reference\/stl\/\">bu sayfaya<\/a><\/strong><\/span> g\u00f6z atabilirler. Burada her bir s\u0131n\u0131fa ili\u015fkin detayl\u0131 bilgi, performans ve servisler s\u0131ralanmaktad\u0131r.<\/p>\n<p>STL g\u00fcnl\u00fck hayatta ihtiya\u00e7 duyabilece\u011fimiz veri yap\u0131lar\u0131na (queue, stack, linked list, vs) ili\u015fkin bir \u00e7ok konteyner s\u0131n\u0131f\u0131n\u0131 i\u00e7erisinde bar\u0131nd\u0131r\u0131yor. Genel olarak bunlar olduk\u00e7a h\u0131zl\u0131 ve verimli bir \u015fekilde ger\u00e7eklenmi\u015f durumda. Hepsi ortak aray\u00fczler sunuyorlar ve iyi bir \u015fekilde d\u00f6k\u00fcmante edilmi\u015f durumdalar. Genel olarak bu konteynerler d\u00f6rt ana gruba ayr\u0131l\u0131yor:<\/p>\n<ul>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/named_req\/SequenceContainer\">S\u0131ral\u0131 Konteynerler (&#8220;Sequence containers&#8221;)<\/a><\/span><\/strong>\n<ul>\n<li>Ayn\u0131 tip verileri s\u0131ral\u0131 bir \u015fekilde saklayan veri yap\u0131lar\u0131n\u0131 ifade etmek i\u00e7in kullan\u0131l\u0131rlar,<\/li>\n<li>Bu grup alt\u0131nda <em><strong>array<\/strong> <\/em>(statik veri dizisi), <em><strong>vector<\/strong> <\/em>(dinamik veri dizisi), <em><strong>forward_list<\/strong><\/em> (tek y\u00f6nl\u00fc ba\u011fl\u0131 liste), <em><strong>list<\/strong><\/em> (\u00e7ift y\u00f6nl\u00fc ba\u011fl\u0131 liste) ve <em><strong>deque<\/strong> <\/em>(\u00e7ift y\u00f6nl\u00fc kuyruk) konteynerleri var.<\/li>\n<\/ul>\n<\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/named_req\/AssociativeContainer\">\u0130li\u015fkili Konteynerler (&#8220;Associative containers&#8221;)<\/a><\/span><\/strong>\n<ul>\n<li>H\u0131zl\u0131 eri\u015fime olanak sa\u011flamak ad\u0131na s\u0131ral\u0131 veri yap\u0131lar\u0131 sunan konteynerleri kapsar,<\/li>\n<li>Bu grup alt\u0131nda <em><strong>set<\/strong> <\/em>(tekli s\u0131ral\u0131 k\u00fcme), <em><strong>map<\/strong> <\/em>(tekli ili\u015fkili dizi, anahtarlara g\u00f6re s\u0131ral\u0131) , <em><strong>multiset<\/strong> <\/em>(\u00e7oklu s\u0131ral\u0131 k\u00fcme), <em><strong>multimap<\/strong> <\/em>(\u00e7oklu ili\u015fkili dizi, anahtarlara g\u00f6re s\u0131ral\u0131) konteynerleri var.<\/li>\n<\/ul>\n<\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/named_req\/UnorderedAssociativeContainer\">S\u0131ras\u0131z \u0130li\u015fkili Konteynerler (&#8220;Unordered associative containers&#8221;)<\/a><\/span><\/strong>\n<ul>\n<li>\u0130li\u015fkili dizilerden farkl\u0131 olarak s\u0131ras\u0131z fakat h\u0131zl\u0131 eri\u015fim ( en k\u00f6t\u00fc durumda O(n)\u00a0 ) ad\u0131na hash kullanan veri yap\u0131lar\u0131n\u0131 ifade eden konteynerleri i\u00e7erisinde bar\u0131nd\u0131r\u0131r,<\/li>\n<li>Bu s\u0131n\u0131flar C++ 11 ile birlikte sunulmaya ba\u015fland\u0131lar,<\/li>\n<li>Bu grup alt\u0131nda <em><strong>unordered_set, unordered_map, unordered_multiset<\/strong><\/em> ve <em><strong>unordered_multimap<\/strong> <\/em>konteynerlerini i\u00e7erisinde bar\u0131nd\u0131r\u0131r. Bunlar ili\u015fkili konteynerlerin hash kullanan kar\u015f\u0131l\u0131klar\u0131d\u0131r.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Konteyner Adapt\u00f6rleri (&#8220;Container adapters&#8221;)<\/strong>\n<ul>\n<li>Bunlar al\u0131nda kendi ba\u015flar\u0131na bir konteyner olmayan, daha \u00e7ok yukar\u0131dakileri kullanan\/sarmalayan s\u0131n\u0131flar olarak d\u00fc\u015f\u00fcn\u00fclebilir,<\/li>\n<li>Bu grup alt\u0131nda <em><strong>stack<\/strong> <\/em>(&#8220;LIFO &#8211; Last in first out&#8221; y\u0131\u011f\u0131n veri yap\u0131s\u0131), <em><strong>queue<\/strong> <\/em>(&#8220;LILO &#8211; Last in last out&#8221; kuyruk veri yap\u0131s\u0131) ve <em><strong>priority_queue<\/strong> <\/em>konteynerleridir. Bunlara ili\u015fkin kabiliyet ve servisler <em>vector<\/em>, <em>deque<\/em> ve <em>list<\/em> ile de sunulabilmekte.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u015eimdi gelelim problemimize elimizde s\u0131ral\u0131 konteynerler var (\u00f6r. <em>vector<\/em>) ve ekledi\u011fimiz her eleman ile s\u0131ran\u0131n bozulmadan korunmas\u0131n\u0131 istiyoruz bunu kolay bir \u015fekilde nas\u0131l yapabiliriz?<\/p>\n<p>\u0130lk y\u00f6ntem her ekleme sonras\u0131 &#8220;<em>algorithm<\/em>&#8221; k\u00fct\u00fcphanesi taraf\u0131ndan sunulan <em>sort()<\/em> metodunu kullanmak olabilir ki tahmin edece\u011finiz \u00fczere pek ucuz bir y\u00f6ntem olmayacakt\u0131r \ud83d\ude42 Neyse a\u015fa\u011f\u0131da \u00f6rnek bir <em>vector<\/em> ilklendirelim ve bunu s\u0131ralayal\u0131m.<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;iostream&gt;\r\n#include &lt;vector&gt;\r\n#include &lt;string&gt;\r\n#include &lt;algorithm&gt;\r\n#include &lt;iterator&gt;\r\n#include &lt;cassert&gt;\r\nusing namespace std;\r\n\r\nvoid printContent(auto&amp; container)\r\n{\r\n   for (const auto &amp;w : container) \r\n   {\r\n        cout &lt;&lt; w &lt;&lt; \" \";\r\n   }\r\n   cout &lt;&lt; endl;\r\n}\r\n\r\nint main()\r\n{\r\n  vector&lt;string&gt; v {\"selim\", \"rasim\", \"kaz\u0131m\", \"kutlu\", \"osman\", \"can\",\"ali\"};\r\n\r\n  \/\/ is_sorted detaylari i\u00e7in https:\/\/en.cppreference.com\/w\/cpp\/algorithm\/is_sorted\r\n  assert(false == is_sorted(begin(v), end(v)));  \r\n  sort(begin(v), end(v));  \r\n  assert(true == is_sorted(begin(v), end(v)));\r\n\r\n  return 0;\r\n}<\/pre>\n<p>Evet s\u0131ral\u0131 eklemek i\u00e7in yine &#8220;<em>algorithm<\/em>&#8221; k\u00fct\u00fcphanesinden bir metottan yard\u0131m alaca\u011f\u0131z. Bu metot <em><strong>lower_bound<\/strong><\/em>().\u00a0 A\u015fa\u011f\u0131da bu metodun tan\u0131m\u0131n\u0131 g\u00f6rebilirsiniz:<\/p>\n<pre class=\"lang:c++ decode:true\">template &lt;class ForwardIterator, class T&gt;\r\nForwardIterator lower_bound (ForwardIterator first, ForwardIterator last, const T&amp; val);<\/pre>\n<p>Metot k\u0131saca [First, Last) aral\u0131\u011f\u0131ndaki verilen val de\u011ferinden k\u00fc\u00e7\u00fck olmayan ilk eleman\u0131 i\u015faret eden iterator&#8217;\u00fc d\u00f6n\u00fcyor.<\/p>\n<p>\u00d6rne\u011fin: {10, 20, 30, 40, 50} girdisi i\u00e7in 10 ve 50 aras\u0131nda 35 de\u011feri i\u00e7in bu metot 3 d\u00f6necek, 15 i\u00e7in ise 1 d\u00f6necek.<\/p>\n<p>A\u015fa\u011f\u0131da bu metodun ve karde\u015finin (<em>upper_bound<\/em>()) kullan\u0131ma ili\u015fkin \u00f6rnek bir kod ta g\u00f6rebilirsiniz:<\/p>\n<pre class=\"lang:c++ decode:true \">#include &lt;iostream&gt;\r\n#include &lt;algorithm&gt;\r\n#include &lt;vector&gt;\r\nusing namespace std;\r\n\r\nint main ()\r\n{\r\n  vector&lt;int&gt; v {10,20,30,30,20,10,10,20};\r\n\r\n  \/\/ Once bir siralayalim \r\n  sort (v.begin(), v.end());                          \/\/ 10 10 10 20 20 20 30 30\r\n\r\n  auto low = std::lower_bound (begin(v), end(v), 20); \/\/          ^\r\n  auto up  = std::upper_bound (begin(v), end(v), 20); \/\/                   ^\r\n\r\n  std::cout &lt;&lt; \"lower_bound pozisyonu: \" &lt;&lt; (low- begin(v)) &lt;&lt; endl;\r\n  std::cout &lt;&lt; \"upper_bound pozisyonu: \" &lt;&lt; (up - begin(v)) &lt;&lt; endl;\r\n\r\n  return 0;\r\n}<\/pre>\n<p>\u015eimdi geldi s\u0131ra assolistimize (<em><strong>addSorted<\/strong><\/em>) \ud83d\ude42<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;iostream&gt;\r\n#include &lt;vector&gt;\r\n#include &lt;string&gt;\r\n#include &lt;algorithm&gt;\r\n#include &lt;iterator&gt;\r\n#include &lt;cassert&gt;\r\nusing namespace std;\r\n\r\nvoid printContent(auto&amp; container)\r\n{\r\n   for (const auto &amp;w : container) \r\n   {\r\n        cout &lt;&lt; w &lt;&lt; \" \";\r\n   }\r\n   cout &lt;&lt; endl;\r\n}\r\n\r\n\/\/ Assolistimiz\r\nvoid addSorted(vector&lt;string&gt; &amp;v, const string &amp;word)\r\n{\r\n     const auto insertPos (lower_bound(begin(v), end(v), word));\r\n     v.insert(insertPos, word);\r\n}\r\n\r\nint main()\r\n{\r\n  vector&lt;string&gt; v {\"selim\", \"rasim\", \"kaz\u0131m\", \"kutlu\", \"osman\", \"can\",\"ali\"};\r\n\r\n  printContent(v);\r\n  \r\n  \/\/ is_sorted detaylari i\u00e7in https:\/\/en.cppreference.com\/w\/cpp\/algorithm\/is_sorted\r\n  assert(false == is_sorted(begin(v), end(v)));  \r\n  sort(begin(v), end(v));  \r\n  assert(true == is_sorted(begin(v), end(v)));\r\n  \r\n  printContent(v);\r\n  \r\n  addSorted(v, \"fatih\");\r\n  printContent(v);\r\n  \r\n  addSorted(v, \"ahmet\");\r\n  printContent(v);\r\n  \r\n  addSorted(v, \"lale\");\r\n  printContent(v);\r\n\r\n  return 0;\r\n}<\/pre>\n<p><em>addSorted<\/em>() metodu nas\u0131l \u00e7al\u0131\u015f\u0131yor? Asl\u0131nda b\u00fct\u00fcn espri <em>lower_bound<\/em>() metodunda b\u00fct\u00fcn listeyi bu metoda ge\u00e7iriyoruz ve o da bize de\u011feri ekleyece\u011fimiz yeri d\u00f6n\u00fcyor. Daha sonra da vector s\u0131n\u0131f\u0131n\u0131n <em>insert<\/em>() metodu ile eleman\u0131 ekliyoruz.<\/p>\n<p>Tabi \u015fimdi bunu di\u011fer konteynerler de kullanamaz m\u0131y\u0131z diye sordu\u011funu duyar gibiyim. Elbette sevgili yaz\u0131l\u0131mperver dostum elbette. Bunun i\u00e7in &#8220;template&#8221; lar\u0131 kullanaca\u011f\u0131z. A\u015fa\u011f\u0131da daha jenerik <em>addSorted<\/em>() metodumuz ve bunu <em>list<\/em> ile olan kullan\u0131m\u0131n\u0131 bulabilirsin.<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;iostream&gt;\r\n#include &lt;list&gt;\r\n#include &lt;string&gt;\r\n#include &lt;algorithm&gt;\r\n#include &lt;iterator&gt;\r\nusing namespace std;\r\n\r\nvoid printContent(auto&amp; container)\r\n{\r\n   for (const auto &amp;w : container) \r\n   {\r\n        cout &lt;&lt; w &lt;&lt; \" \";\r\n   }\r\n   cout &lt;&lt; endl;\r\n}\r\n\r\ntemplate &lt;typename C, typename T&gt;\r\nvoid addSorted(C &amp;v, const T &amp;item)\r\n{\r\n     const auto insert_pos (lower_bound(begin(v), end(v), item));\r\n     v.insert(insert_pos, item);\r\n}\r\n\r\nint main()\r\n{\r\n  list&lt;string&gt; v;\r\n  addSorted&lt;list&lt;string&gt;, string&gt;(v, \"deneme\");\r\n  printContent(v);\r\n  \r\n  addSorted&lt;list&lt;string&gt;, string&gt;(v, \"fatih\");\r\n  printContent(v);\r\n  \r\n  addSorted&lt;list&lt;string&gt;, string&gt;(v, \"ahmet\");\r\n  printContent(v);\r\n  \r\n  addSorted&lt;list&lt;string&gt;, string&gt;(v, \"lale\");\r\n  printContent(v);\r\n\r\n  return 0;\r\n}<\/pre>\n<p>Bir sonraki haftal\u0131k C++ yaz\u0131mda g\u00f6r\u00fc\u015fmek \u00fczere.<\/p>\n<p>Kendinize iyi bak\u0131n.[:en]Hello everybody,<\/p>\n<p>We continue to our Weekly C++ posts. This week&#8217;s problem is to check if it is possible to keep the containers like std::vector sorted as inserting new elements. Well the short answer is yes!<\/p>\n<p>Before delving into problem, let me briefly talk about containers as we need to mention the nature of containers while dealing with problem. I will not explain all details but if you are interested in details you can <span style=\"color: #339966;\"><strong><a style=\"color: #339966;\" href=\"http:\/\/www.cplusplus.com\/reference\/stl\/\">check this page out<\/a><\/strong><\/span>. You can find a summary of all classes and operations.<\/p>\n<p>STL contains many data structures that you may need during developing your applications. Generally, these are optimized and efficient classes which are being used extensively in production code. Most of them have similar interfaces and very well documented. We can group these containers as follow:<\/p>\n<ul>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/named_req\/SequenceContainer\">Sequence containers<\/a><\/span><\/strong>\n<ul>\n<li>Covers the data structures that store same type of data sequentially,<\/li>\n<li><em><strong>array<\/strong> <\/em>(statik veri dizisi), <em><strong>vector<\/strong> <\/em>(dinamik veri dizisi), <em><strong>forward_list<\/strong><\/em> (tek y\u00f6nl\u00fc ba\u011fl\u0131 liste), <em><strong>list<\/strong><\/em> (\u00e7ift y\u00f6nl\u00fc ba\u011fl\u0131 liste) ve <em><strong>deque<\/strong> <\/em>(\u00e7ift y\u00f6nl\u00fc kuyruk) are the containers that listed under this group.<\/li>\n<\/ul>\n<\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/named_req\/AssociativeContainer\">Associative containers<\/a><\/span><\/strong>\n<ul>\n<li>Covers the sorted data structures that can be quickly searched,<\/li>\n<li><em><strong>set<\/strong> <\/em>(tekli s\u0131ral\u0131 k\u00fcme), <em><strong>map<\/strong> <\/em>(tekli ili\u015fkili dizi, anahtarlara g\u00f6re s\u0131ral\u0131) , <em><strong>multiset<\/strong> <\/em>(\u00e7oklu s\u0131ral\u0131 k\u00fcme), <em><strong>multimap<\/strong> <\/em>(\u00e7oklu ili\u015fkili dizi, anahtarlara g\u00f6re s\u0131ral\u0131) are the containers that listed under this group.<\/li>\n<\/ul>\n<\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/named_req\/UnorderedAssociativeContainer\">Unordered containers<\/a><\/span><\/strong>\n<ul>\n<li>Different from the previous group of containers, these containers are not ordered, however, they use hash data structure for fast access and search,<\/li>\n<li>These are introduced with C++ 11 ,<\/li>\n<li><em><strong>unordered_set, unordered_map, unordered_multiset<\/strong><\/em> ve <em><strong>unordered_multimap\u00a0<\/strong><\/em>are the containers that listed under this groups. These are the hash-based version of associative containers.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Container adapters<\/strong>\n<ul>\n<li>This group of containers are wrapper to sequential container which provide different interfaces,<\/li>\n<li><em><strong>stack<\/strong> <\/em>(&#8220;LIFO &#8211; Last in first out&#8221; y\u0131\u011f\u0131n veri yap\u0131s\u0131), <em><strong>queue<\/strong> <\/em>(&#8220;LILO &#8211; Last in last out&#8221; kuyruk veri yap\u0131s\u0131) ve <em><strong>priority_queue\u00a0<\/strong><\/em>are the containers that listed under this group. In fact, similar behavior and capabilities can be achieved with containers using\u00a0<em>vector<\/em>, <em>deque<\/em> and\u00a0<em>list<\/em>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Now lets go back to our problem. We have a sequential container (e.g. <em>vector<\/em>) and we would like to keep it sorted with consequtive insertion operations. How can we achieve this?<\/p>\n<p>Well, obviously the first method is to use the <em>sort()\u00a0<\/em>method provided by &#8220;<em>algorithm<\/em>&#8221; library which as you may guess will not be cheap \ud83d\ude42 Now, lets initialize a <em>vector<\/em> and then sort it:<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;iostream&gt;\r\n#include &lt;vector&gt;\r\n#include &lt;string&gt;\r\n#include &lt;algorithm&gt;\r\n#include &lt;iterator&gt;\r\n#include &lt;cassert&gt;\r\nusing namespace std;\r\n\r\nvoid printContent(auto&amp; container)\r\n{\r\n   for (const auto &amp;w : container) \r\n   {\r\n        cout &lt;&lt; w &lt;&lt; \" \";\r\n   }\r\n   cout &lt;&lt; endl;\r\n}\r\n\r\nint main()\r\n{\r\n  vector&lt;string&gt; v {\"selim\", \"rasim\", \"kaz\u0131m\", \"kutlu\", \"osman\", \"can\",\"ali\"};\r\n\r\n  \/\/ For details of is_sorted check out: https:\/\/en.cppreference.com\/w\/cpp\/algorithm\/is_sorted\r\n  assert(false == is_sorted(begin(v), end(v)));  \r\n  sort(begin(v), end(v));  \r\n  assert(true == is_sorted(begin(v), end(v)));\r\n\r\n  return 0;\r\n}<\/pre>\n<p>Well, to resolve this problem, we will employ another method from &#8220;<em>algorithm<\/em>&#8221; library which is <em><strong>lower_bound<\/strong><\/em>() method.\u00a0 \u00a0You can find the signature of this method below:<\/p>\n<pre class=\"lang:c++ decode:true\">template &lt;class ForwardIterator, class T&gt;\r\nForwardIterator lower_bound (ForwardIterator first, ForwardIterator last, const T&amp; val);<\/pre>\n<p>Briefly this method returns the iterator that points the index of first element which is not less (which of course might be equal) than provided value in\u00a0given range of [First, Last) .<\/p>\n<p>For instance, for provided {10, 20, 30, 40, 50} input and range of [10, 50] and 35 input value it will return 3 and for input value 15 it will return 1.<\/p>\n<p>You can find an example usage of this method with its sister (<em>upper_bound<\/em>()):<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;iostream&gt;\r\n#include &lt;algorithm&gt;\r\n#include &lt;vector&gt;\r\nusing namespace std;\r\n\r\nint main ()\r\n{\r\n  vector&lt;int&gt; v {10,20,30,30,20,10,10,20};\r\n\r\n  \/\/ First sort the input \r\n  sort (v.begin(), v.end());                          \/\/ 10 10 10 20 20 20 30 30\r\n\r\n  auto low = std::lower_bound (begin(v), end(v), 20); \/\/          ^\r\n  auto up  = std::upper_bound (begin(v), end(v), 20); \/\/                   ^\r\n\r\n  std::cout &lt;&lt; \"lower_bound index: \" &lt;&lt; (low- begin(v)) &lt;&lt; endl;\r\n  std::cout &lt;&lt; \"upper_bound index: \" &lt;&lt; (up - begin(v)) &lt;&lt; endl;\r\n\r\n  return 0;\r\n}<\/pre>\n<p>Finally, let&#8217;s define our method:\u00a0<em><strong>addSorted()<\/strong><\/em><\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;iostream&gt;\r\n#include &lt;vector&gt;\r\n#include &lt;string&gt;\r\n#include &lt;algorithm&gt;\r\n#include &lt;iterator&gt;\r\n#include &lt;cassert&gt;\r\nusing namespace std;\r\n\r\nvoid printContent(auto&amp; container)\r\n{\r\n   for (const auto &amp;w : container) \r\n   {\r\n        cout &lt;&lt; w &lt;&lt; \" \";\r\n   }\r\n   cout &lt;&lt; endl;\r\n}\r\n\r\n\/\/ Our method\r\nvoid addSorted(vector&lt;string&gt; &amp;v, const string &amp;word)\r\n{\r\n     const auto insertPos (lower_bound(begin(v), end(v), word));\r\n     v.insert(insertPos, word);\r\n}\r\n\r\nint main()\r\n{\r\n  vector&lt;string&gt; v {\"selim\", \"rasim\", \"kaz\u0131m\", \"kutlu\", \"osman\", \"can\",\"ali\"};\r\n\r\n  printContent(v);\r\n  \r\n  \/\/ For details of is_sorted check out https:\/\/en.cppreference.com\/w\/cpp\/algorithm\/is_sorted\r\n  assert(false == is_sorted(begin(v), end(v)));  \r\n  sort(begin(v), end(v));  \r\n  assert(true == is_sorted(begin(v), end(v)));\r\n  \r\n  printContent(v);\r\n  \r\n  addSorted(v, \"fatih\");\r\n  printContent(v);\r\n  \r\n  addSorted(v, \"ahmet\");\r\n  printContent(v);\r\n  \r\n  addSorted(v, \"lale\");\r\n  printContent(v);\r\n\r\n  return 0;\r\n}<\/pre>\n<p>how <em>addSorted<\/em>() method works? In fact, <em>lower_bound<\/em>() performs the most of the task that we need and return the place that we should add new element. Then what we need to do is simply call <em>insert<\/em>() method of <em>vector<\/em>.<\/p>\n<p>Now you may wonder if we can utilize this method with other containers. Well, sure, as long as they are sequential container. To do so, we will get help from templates. Below you can find the generic version of <em>addSorted<\/em>() method and example usage with <em>list<\/em> container.<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;iostream&gt;\r\n#include &lt;list&gt;\r\n#include &lt;string&gt;\r\n#include &lt;algorithm&gt;\r\n#include &lt;iterator&gt;\r\nusing namespace std;\r\n\r\nvoid printContent(auto&amp; container)\r\n{\r\n   for (const auto &amp;w : container) \r\n   {\r\n        cout &lt;&lt; w &lt;&lt; \" \";\r\n   }\r\n   cout &lt;&lt; endl;\r\n}\r\n\r\ntemplate &lt;typename C, typename T&gt;\r\nvoid addSorted(C &amp;v, const T &amp;item)\r\n{\r\n     const auto insert_pos (lower_bound(begin(v), end(v), item));\r\n     v.insert(insert_pos, item);\r\n}\r\n\r\nint main()\r\n{\r\n  list&lt;string&gt; v;\r\n  addSorted&lt;list&lt;string&gt;, string&gt;(v, \"deneme\");\r\n  printContent(v);\r\n  \r\n  addSorted&lt;list&lt;string&gt;, string&gt;(v, \"fatih\");\r\n  printContent(v);\r\n  \r\n  addSorted&lt;list&lt;string&gt;, string&gt;(v, \"ahmet\");\r\n  printContent(v);\r\n  \r\n  addSorted&lt;list&lt;string&gt;, string&gt;(v, \"lale\");\r\n  printContent(v);\r\n\r\n  return 0;\r\n}<\/pre>\n<p>See you soon in another Weekly C++ post.[:]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[:tr]Merhaba arkada\u015flar, Haftal\u0131k C++ kod \u00f6rneklerimize devam ediyoruz. Bu haftaki problemimiz std::vector gibi konteynerlere (nedir arkada\u015f bu STL konteyner sevdas\u0131 yahu \ud83d\ude42 duyar gibiyim) bir yandan veri eklerken bir yandan da bunlar\u0131 s\u0131ral\u0131 tutabilir miyiz? Bu probleme ge\u00e7meden \u00f6nce konteyner konusuna ufak bir e\u011filelim, \u00e7\u00fcnk\u00fc buradaki problemi \u00e7\u00f6zerken bir miktar de\u011finmemiz gerekecek. Bu s\u0131n\u0131flar\u0131n detaylar\u0131na&#8230; <a class=\"more-link\" href=\"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/\">Continue reading <span class=\"meta-nav\">&#8594;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":174,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"dsgo_overlay_header":false,"dsgo_overlay_header_text_color":"","dsgo_overlay_skip_top_bar":false,"_designsetgo_exclude_llms":false,"footnotes":""},"categories":[10,41],"tags":[222,13,215,220,216,219,223,218,221,224,217],"class_list":["post-584","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c","category-modern-c","tag-algorithm","tag-c","tag-containers","tag-deque","tag-keep-sorted","tag-list","tag-lower_bound","tag-queue","tag-stack","tag-upper_bound","tag-vector"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[:tr]Haftal\u0131k C++ 2 - Konteynerler ve s\u0131ral\u0131 tutma [:en]Weekly C++ 2 - Containers and keeping sorted [:] - Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[:tr]Haftal\u0131k C++ 2 - Konteynerler ve s\u0131ral\u0131 tutma [:en]Weekly C++ 2 - Containers and keeping sorted [:] - Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131\" \/>\n<meta property=\"og:description\" content=\"[:tr]Merhaba arkada\u015flar, Haftal\u0131k C++ kod \u00f6rneklerimize devam ediyoruz. Bu haftaki problemimiz std::vector gibi konteynerlere (nedir arkada\u015f bu STL konteyner sevdas\u0131 yahu \ud83d\ude42 duyar gibiyim) bir yandan veri eklerken bir yandan da bunlar\u0131 s\u0131ral\u0131 tutabilir miyiz? Bu probleme ge\u00e7meden \u00f6nce konteyner konusuna ufak bir e\u011filelim, \u00e7\u00fcnk\u00fc buradaki problemi \u00e7\u00f6zerken bir miktar de\u011finmemiz gerekecek. Bu s\u0131n\u0131flar\u0131n detaylar\u0131na... Continue reading &#8594;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/\" \/>\n<meta property=\"og:site_name\" content=\"Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-25T19:54:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-08T20:30:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/yazilimperver.net\/wp-content\/uploads\/2017\/12\/FeaturedImage-e1580417052514.png\" \/>\n\t<meta property=\"og:image:width\" content=\"32\" \/>\n\t<meta property=\"og:image:height\" content=\"32\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"yaz\u0131l\u0131mperver\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"yaz\u0131l\u0131mperver\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/10\\\/25\\\/haftalik-c-2-konteynerler-ve-sirali-tutma\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/10\\\/25\\\/haftalik-c-2-konteynerler-ve-sirali-tutma\\\/\"},\"author\":{\"name\":\"yaz\u0131l\u0131mperver\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/#\\\/schema\\\/person\\\/534a27860d56170658018ac4c6f1af16\"},\"headline\":\"[:tr]Haftal\u0131k C++ 2 &#8211; Konteynerler ve s\u0131ral\u0131 tutma [:en]Weekly C++ 2 &#8211; Containers and keeping sorted [:]\",\"datePublished\":\"2018-10-25T19:54:40+00:00\",\"dateModified\":\"2022-01-08T20:30:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/10\\\/25\\\/haftalik-c-2-konteynerler-ve-sirali-tutma\\\/\"},\"wordCount\":1361,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/#\\\/schema\\\/person\\\/534a27860d56170658018ac4c6f1af16\"},\"image\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/10\\\/25\\\/haftalik-c-2-konteynerler-ve-sirali-tutma\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/FeaturedImage-e1580417052514.png\",\"keywords\":[\"algorithm\",\"c++\",\"containers\",\"deque\",\"keep sorted\",\"list\",\"lower_bound\",\"queue\",\"stack\",\"upper_bound\",\"vector\"],\"articleSection\":[\"C++\",\"Modern C++\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/10\\\/25\\\/haftalik-c-2-konteynerler-ve-sirali-tutma\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/10\\\/25\\\/haftalik-c-2-konteynerler-ve-sirali-tutma\\\/\",\"url\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/10\\\/25\\\/haftalik-c-2-konteynerler-ve-sirali-tutma\\\/\",\"name\":\"[:tr]Haftal\u0131k C++ 2 - Konteynerler ve s\u0131ral\u0131 tutma [:en]Weekly C++ 2 - Containers and keeping sorted [:] - Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/10\\\/25\\\/haftalik-c-2-konteynerler-ve-sirali-tutma\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/10\\\/25\\\/haftalik-c-2-konteynerler-ve-sirali-tutma\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/FeaturedImage-e1580417052514.png\",\"datePublished\":\"2018-10-25T19:54:40+00:00\",\"dateModified\":\"2022-01-08T20:30:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/10\\\/25\\\/haftalik-c-2-konteynerler-ve-sirali-tutma\\\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/10\\\/25\\\/haftalik-c-2-konteynerler-ve-sirali-tutma\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/10\\\/25\\\/haftalik-c-2-konteynerler-ve-sirali-tutma\\\/#primaryimage\",\"url\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/FeaturedImage-e1580417052514.png\",\"contentUrl\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/FeaturedImage-e1580417052514.png\",\"width\":32,\"height\":32},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/10\\\/25\\\/haftalik-c-2-konteynerler-ve-sirali-tutma\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ana sayfa\",\"item\":\"https:\\\/\\\/yazilimperver.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Haftal\u0131k C++ 2 &#8211; Konteynerler ve s\u0131ral\u0131 tutma\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/#website\",\"url\":\"https:\\\/\\\/yazilimperver.net\\\/\",\"name\":\"Yaz\u0131l\u0131mperver'in D\u00fcnyas\u0131\",\"description\":\"Payla\u015fmak g\u00fczeldir.\",\"publisher\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/#\\\/schema\\\/person\\\/534a27860d56170658018ac4c6f1af16\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/yazilimperver.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/#\\\/schema\\\/person\\\/534a27860d56170658018ac4c6f1af16\",\"name\":\"yaz\u0131l\u0131mperver\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/cropped-OnlyIcon-1.png\",\"url\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/cropped-OnlyIcon-1.png\",\"contentUrl\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/cropped-OnlyIcon-1.png\",\"width\":512,\"height\":512,\"caption\":\"yaz\u0131l\u0131mperver\"},\"logo\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/cropped-OnlyIcon-1.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[:tr]Haftal\u0131k C++ 2 - Konteynerler ve s\u0131ral\u0131 tutma [:en]Weekly C++ 2 - Containers and keeping sorted [:] - Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/","og_locale":"tr_TR","og_type":"article","og_title":"[:tr]Haftal\u0131k C++ 2 - Konteynerler ve s\u0131ral\u0131 tutma [:en]Weekly C++ 2 - Containers and keeping sorted [:] - Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131","og_description":"[:tr]Merhaba arkada\u015flar, Haftal\u0131k C++ kod \u00f6rneklerimize devam ediyoruz. Bu haftaki problemimiz std::vector gibi konteynerlere (nedir arkada\u015f bu STL konteyner sevdas\u0131 yahu \ud83d\ude42 duyar gibiyim) bir yandan veri eklerken bir yandan da bunlar\u0131 s\u0131ral\u0131 tutabilir miyiz? Bu probleme ge\u00e7meden \u00f6nce konteyner konusuna ufak bir e\u011filelim, \u00e7\u00fcnk\u00fc buradaki problemi \u00e7\u00f6zerken bir miktar de\u011finmemiz gerekecek. Bu s\u0131n\u0131flar\u0131n detaylar\u0131na... Continue reading &#8594;","og_url":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/","og_site_name":"Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131","article_published_time":"2018-10-25T19:54:40+00:00","article_modified_time":"2022-01-08T20:30:35+00:00","og_image":[{"width":32,"height":32,"url":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2017\/12\/FeaturedImage-e1580417052514.png","type":"image\/png"}],"author":"yaz\u0131l\u0131mperver","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"yaz\u0131l\u0131mperver","Tahmini okuma s\u00fcresi":"11 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/#article","isPartOf":{"@id":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/"},"author":{"name":"yaz\u0131l\u0131mperver","@id":"https:\/\/yazilimperver.net\/#\/schema\/person\/534a27860d56170658018ac4c6f1af16"},"headline":"[:tr]Haftal\u0131k C++ 2 &#8211; Konteynerler ve s\u0131ral\u0131 tutma [:en]Weekly C++ 2 &#8211; Containers and keeping sorted [:]","datePublished":"2018-10-25T19:54:40+00:00","dateModified":"2022-01-08T20:30:35+00:00","mainEntityOfPage":{"@id":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/"},"wordCount":1361,"commentCount":2,"publisher":{"@id":"https:\/\/yazilimperver.net\/#\/schema\/person\/534a27860d56170658018ac4c6f1af16"},"image":{"@id":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/#primaryimage"},"thumbnailUrl":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2017\/12\/FeaturedImage-e1580417052514.png","keywords":["algorithm","c++","containers","deque","keep sorted","list","lower_bound","queue","stack","upper_bound","vector"],"articleSection":["C++","Modern C++"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/","url":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/","name":"[:tr]Haftal\u0131k C++ 2 - Konteynerler ve s\u0131ral\u0131 tutma [:en]Weekly C++ 2 - Containers and keeping sorted [:] - Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131","isPartOf":{"@id":"https:\/\/yazilimperver.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/#primaryimage"},"image":{"@id":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/#primaryimage"},"thumbnailUrl":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2017\/12\/FeaturedImage-e1580417052514.png","datePublished":"2018-10-25T19:54:40+00:00","dateModified":"2022-01-08T20:30:35+00:00","breadcrumb":{"@id":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/"]}]},{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/#primaryimage","url":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2017\/12\/FeaturedImage-e1580417052514.png","contentUrl":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2017\/12\/FeaturedImage-e1580417052514.png","width":32,"height":32},{"@type":"BreadcrumbList","@id":"https:\/\/yazilimperver.net\/index.php\/2018\/10\/25\/haftalik-c-2-konteynerler-ve-sirali-tutma\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Ana sayfa","item":"https:\/\/yazilimperver.net\/"},{"@type":"ListItem","position":2,"name":"Haftal\u0131k C++ 2 &#8211; Konteynerler ve s\u0131ral\u0131 tutma"}]},{"@type":"WebSite","@id":"https:\/\/yazilimperver.net\/#website","url":"https:\/\/yazilimperver.net\/","name":"Yaz\u0131l\u0131mperver'in D\u00fcnyas\u0131","description":"Payla\u015fmak g\u00fczeldir.","publisher":{"@id":"https:\/\/yazilimperver.net\/#\/schema\/person\/534a27860d56170658018ac4c6f1af16"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/yazilimperver.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/yazilimperver.net\/#\/schema\/person\/534a27860d56170658018ac4c6f1af16","name":"yaz\u0131l\u0131mperver","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2018\/04\/cropped-OnlyIcon-1.png","url":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2018\/04\/cropped-OnlyIcon-1.png","contentUrl":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2018\/04\/cropped-OnlyIcon-1.png","width":512,"height":512,"caption":"yaz\u0131l\u0131mperver"},"logo":{"@id":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2018\/04\/cropped-OnlyIcon-1.png"}}]}},"_links":{"self":[{"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/posts\/584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/comments?post=584"}],"version-history":[{"count":0,"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/posts\/584\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/media\/174"}],"wp:attachment":[{"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/media?parent=584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/categories?post=584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/tags?post=584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}