{"id":82098,"date":"2021-07-26T09:00:45","date_gmt":"2021-07-26T03:30:45","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=82098"},"modified":"2021-07-26T09:00:45","modified_gmt":"2021-07-26T03:30:45","slug":"selection-sort","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/selection-sort\/","title":{"rendered":"Selection Sort in Data Structure"},"content":{"rendered":"<p>Selection sort is another sorting technique in which we find the minimum element in every iteration and place it in the array beginning from the first index. Thus, a selection sort also gets divided into a sorted and unsorted subarray.<\/p>\n<h3>What is Selection Sort?<\/h3>\n<p>Selection sort has the following characteristics:<\/p>\n<ul>\n<li>Comparison-based sorting algorithm.<\/li>\n<li>Inplace sorting technique.<\/li>\n<li>An unstable sorting algorithm i.e. does not preserve the order of duplicate elements.<\/li>\n<li>Time complexity is O(n<sup>2<\/sup>).<\/li>\n<li>Selection sort is the best algorithm when swapping is a costly operation.<\/li>\n<\/ul>\n<p>In every iteration, the selection sort algorithm selects the smallest element from the whole array and swaps it with the leftmost element of the unsorted sub-array.<\/p>\n<h3>Steps involved in Selection Sort<\/h3>\n<p>1. Find the smallest element in the array and swap it with the first element of the array i.e. a[0].<br \/>\n2. The elements left for sorting are n-1 so far. Find the smallest element in the array from index 1 to n-1 i.e. a[1] to a[n-1] and swap it with a[1].<br \/>\n3. Continue this process for all the elements in the array until we get a sorted list.<\/p>\n<h3>Algorithm for Selection Sort<\/h3>\n<p><span style=\"font-weight: 400\">Step 1: For i = 1 to n-1<\/span><\/p>\n<p><span style=\"font-weight: 400\">step 2: Set min = arr[i]<\/span><\/p>\n<p><span style=\"font-weight: 400\">step 3: Set position = i<\/span><\/p>\n<p><span style=\"font-weight: 400\">step 4: For j = i+1 to n-1 repeat:<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (min &gt; arr[j])<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Set min = arr[j]<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Set position = j<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[end of if]<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[end of loop]<\/span><\/p>\n<p><span style=\"font-weight: 400\">step 5: swap a[i] with arr[position]<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[end of loop]<\/span><\/p>\n<p><span style=\"font-weight: 400\">step 6: END<\/span><\/p>\n<h3>Pseudo-code for Selection Sort<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">procedure Selection_sort(int Arr):\n     for i=0 to length(Arr):\n     Minimum_element  = Arr[0]\n           for each unsorted element:\n                   if element &lt; Minimum_element\n           element = New_minimum\n      swap (Minimum_element, first unsorted position)\nend Selection_sort\n<\/pre>\n<h3>Working of Selection Sort<\/h3>\n<p>Let us understand the working of the selection sort algorithm with the help of the following example:<\/p>\n<p>Consider an array having elements: 40, 10, 35, 15, 20, 2, 10, 7 as shown:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82944\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images01.jpg\" alt=\"Selection sort\" width=\"581\" height=\"128\" \/><\/a><\/p>\n<p>Iteration 1:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images02.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82945\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images02.jpg\" alt=\"Selection sort Iteration\" width=\"581\" height=\"150\" \/><\/a><\/p>\n<p>Iteration 2:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images03.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82946\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images03.jpg\" alt=\"Working of Selection sort\" width=\"581\" height=\"150\" \/><\/a><\/p>\n<p>Iteration 3:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images04.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82947\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images04.jpg\" alt=\"Selection sort algorithm\" width=\"581\" height=\"150\" \/><\/a><\/p>\n<p>Iteration 4:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images05.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82948\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images05.jpg\" alt=\"Working of selection sort\" width=\"581\" height=\"150\" \/><\/a><\/p>\n<p>Iteration 5:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images06.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82949\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images06.jpg\" alt=\"Selection sort working\" width=\"581\" height=\"150\" \/><\/a><\/p>\n<p>Iteration 6:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images07.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82950\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images07.jpg\" alt=\"Selection sort\" width=\"581\" height=\"150\" \/><\/a><\/p>\n<p>Iteration 7:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images08.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82951\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images08.jpg\" alt=\"Working of selection sort\" width=\"581\" height=\"135\" \/><\/a><\/p>\n<p>Iteration 8:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images09.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82952\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images09.jpg\" alt=\"Selection sort\" width=\"581\" height=\"135\" \/><\/a><\/p>\n<p>Thus, the final array after selection sort is:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images10.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82953\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/TechVidvan-Selection-sort-normal-images10.jpg\" alt=\"Selection Sort Output\" width=\"581\" height=\"122\" \/><\/a><\/p>\n<p>In this array, we can clearly see that the order of duplicate elements has changed. Thus, selection sort is an unstable algorithm.<\/p>\n<h3>Implementation of Selection Sort in C<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include&lt;stdio.h&gt;  \nint Minimum_element(int[],int,int); \n\nvoid main ()  \n{  \n    int Arr[] = {12, 5, 34, 21, 45, 100, 25, 17, 40, 3};  \n    int i,position,temp;  \n    int n = sizeof(Arr[])\/sizeof(int);\n    for(i=0; i&lt;n; i++)  \n    {  \n        position = Minimum_element(Arr, n, i);  \n        temp = Arr[i];  \n        Arr[i]=Arr[position];  \n        Arr[position] = temp;  \n    }  \n    printf(\"The sorted array is:\\n\");  \n    for(i=0; i&lt;n; i++)  \n    {  \n        printf(\"%d \",Arr[i]);  \n    }  \n}  \nint Minimum_element(int a[], int n, int i)  \n{  \n    int min, position, j;  \n    min = a[i];  \n    position = i;  \n    for(j=i+1;j&lt;10;j++)  \n    {  \n        if(a[j] &lt; min)  \n        {  \n            min = a[j];  \n            position = j;  \n        }  \n    }  \n    return position;  \n}  \n<\/pre>\n<h3>Selection Sort Implementation in C++<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include&lt;bits\/stdc++.h&gt;\nusing namespace std;\n\nint Minimum_element(int[],int,int); \n\nint main ()  \n{  \n    int Arr[] = {12, 5, 34, 21, 45, 100, 25, 17, 40, 3};  \n    int i, position, temp;\n    int n = sizeof(Arr[])\/sizeof(int);\n    for(i=0; i&lt;n ;i++)  \n    {  \n        position = Minimum_element(Arr, n, i);  \n        temp = Arr[i];  \n        Arr[i] = Arr[position];  \n        Arr[position] = temp;  \n    }  \n    cout &lt;&lt; \"The sorted array is:\\n\";  \n    for(i=0; i&lt;n; i++)  \n    {  \n        cout &lt;&lt; \" \" &lt;&lt; Arr[i];  \n    }  \n}  \nint Minimum_element(int a[], int n, int i)  \n{  \n    int min,position,j;  \n    min = a[i];  \n    position = i;  \n    for(j=i+1; j&lt;10; j++)  \n    {  \n        if(a[j] &lt; min)  \n        {  \n            min = a[j];  \n            position = j;  \n        }  \n    }  \n    return position;  \n} \n<\/pre>\n<h3>Selection Sort Implementation in Java:<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">public class selectionSort \n{\n  void Selection_sort(int Arr[]) \n  {\n    int len = Arr.length;\n\n    for (int j = 0; j&lt;len-1; j++) \n    {\n      int min_position = j;\n\n      for (int i = j + 1; i &lt; len; i++) \n      {\n\n        if (Arr[i] &lt; Arr[min_position]) \n        {\n          min_position = i;\n        }\n      }\n      \n      int temp = Arr[j];\n      Arr[j] = Arr[min_position];\n      Arr[min_position] = temp;\n    }\n    System.out.println(\"The sorted Array is: \");\n    for (int i = 0; i &lt; len; i++) \n    {\n        System.out.print(Arr[i] +\" \");\n        \n    }\n    \n  }\n\n  public static void main(String args[]) \n  {\n    int[] array = {12, 5, 34, 21, 45, 100, 25, 17, 40, 3};\n    aelectionSort ss = new selectionSort();\n    ss.Selection_sort(array);\n    \n    \n  }\n}<\/pre>\n<h3>Implementation of Selection Sort in Python:<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">def Selection_sort(Arr, length):\n   \n    for i in range(length):\n        min_index = i\n\n        for j in range(i + 1, length):\n         \n            if Arr[j] &lt; array[min_index]:\n                min_index = j\n         \n        (Arr[i], Arr[min_index]) = (Arr[min_index], Arr[i])\n\n\nlist = [12, 5, 34, 21, 45, 100, 25, 17, 40, 3]\nlength = len(list)\nSelection_sort(list, length)\nprint('The sorted Array is:')\nprint(list)<\/pre>\n<h3>Complexity of Selection Sort<\/h3>\n<p>The time complexity of selection sort depends upon comparison as well as swap operation. However, a swap operation is very efficient in the selection sort algorithm as compared to other sorting techniques.<\/p>\n<p>The following table shows the number of comparison operations performed in each iteration:<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Iteration\u00a0<\/b><\/td>\n<td><b>Number of comparisons<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">n-1<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">2<\/span><\/td>\n<td><span style=\"font-weight: 400\">n-2<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">3<\/span><\/td>\n<td><span style=\"font-weight: 400\">n-3<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">.<\/span><\/td>\n<td><span style=\"font-weight: 400\">.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">.<\/span><\/td>\n<td><span style=\"font-weight: 400\">.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">.<\/span><\/td>\n<td><span style=\"font-weight: 400\">.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">n-2<\/span><\/td>\n<td><span style=\"font-weight: 400\">2<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">n-1<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Thus, the total number of comparisons are: (n-1) + (n-2) + (n-3)+ \u2026\u2026..+ 1<br \/>\n= n(n-1)\/2<br \/>\n~ n<sup>2<\/sup><\/p>\n<p><strong>1. Best Case<\/strong>: In this case, the data is already sorted inside the array. Thus there will be zero number of swaps but the comparison will occur at every point.<\/p>\n<p><strong>2. Average case<\/strong>: Elements are neither in increasing order nor decreasing order. The values in the array are randomly placed.<\/p>\n<p><strong>3. Worst case<\/strong>: In the worst case, the array is completely in decreasing or in the non-increasing order. It will have maximum swaps as well as the maximum number of comparisons.<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Scenario\u00a0<\/b><\/td>\n<td><b>Time complexity<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Worst case<\/span><\/td>\n<td><span style=\"font-weight: 400\">O(n<\/span><sup><span style=\"font-weight: 400\">2 <\/span><\/sup><span style=\"font-weight: 400\">)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Average case<\/span><\/td>\n<td><span style=\"font-weight: 400\">O(n<sup>2 <\/sup><\/span><span style=\"font-weight: 400\">\u00a0<\/span><span style=\"font-weight: 400\">)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Best case<\/span><\/td>\n<td><span style=\"font-weight: 400\">O(n<sup>2 <\/sup><\/span><span style=\"font-weight: 400\">)<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The space complexity of the selection sort algorithm is O(1).<\/p>\n<h3>Applications of Selection Sort:<\/h3>\n<p>The selection sort technique has the following applications:<\/p>\n<ul>\n<li>Applicable for smaller datasets.<\/li>\n<li>Used in those algorithms where the cost of swapping does not matter.<\/li>\n<li>It cannot work for online data. It needs to have all the array elements for each iteration.<\/li>\n<li>Best suitable when the cost of writing in flash memory matters.<\/li>\n<\/ul>\n<h3>Conclusion<\/h3>\n<p>In this article, we have covered another sorting technique named selection sort. We have covered the characteristics of selection sort which make it different from other sorting techniques.<\/p>\n<p>We have also seen the working of selection sort along with code snippets in different programming languages.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Selection sort is another sorting technique in which we find the minimum element in every iteration and place it in the array beginning from the first index. Thus, a selection sort also gets divided&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":82943,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3555],"tags":[3831,3832,3833,3834,3835],"class_list":["post-82098","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-structure","tag-algorithm-for-selection-sort","tag-implementation-of-selection-sort-in-c","tag-pseudo-code-for-selection-sort","tag-selection-sort","tag-working-of-selection-sort"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Selection Sort in Data Structure - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn about selection sort in data structure. See the characteristics of selection sort which make it different from other sorting techniques.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/selection-sort\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Selection Sort in Data Structure - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn about selection sort in data structure. See the characteristics of selection sort which make it different from other sorting techniques.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/selection-sort\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-26T03:30:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/TV-selection-sort-in-DS.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Selection Sort in Data Structure - TechVidvan","description":"Learn about selection sort in data structure. See the characteristics of selection sort which make it different from other sorting techniques.","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:\/\/techvidvan.com\/tutorials\/selection-sort\/","og_locale":"en_US","og_type":"article","og_title":"Selection Sort in Data Structure - TechVidvan","og_description":"Learn about selection sort in data structure. See the characteristics of selection sort which make it different from other sorting techniques.","og_url":"https:\/\/techvidvan.com\/tutorials\/selection-sort\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2021-07-26T03:30:45+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/TV-selection-sort-in-DS.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/selection-sort\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/selection-sort\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Selection Sort in Data Structure","datePublished":"2021-07-26T03:30:45+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/selection-sort\/"},"wordCount":613,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/selection-sort\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/TV-selection-sort-in-DS.jpg","keywords":["Algorithm for Selection Sort","Implementation of Selection Sort in C","Pseudo-code for Selection Sort","selection sort","Working of Selection Sort"],"articleSection":["Data Structure Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/selection-sort\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/selection-sort\/","url":"https:\/\/techvidvan.com\/tutorials\/selection-sort\/","name":"Selection Sort in Data Structure - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/selection-sort\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/selection-sort\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/TV-selection-sort-in-DS.jpg","datePublished":"2021-07-26T03:30:45+00:00","description":"Learn about selection sort in data structure. See the characteristics of selection sort which make it different from other sorting techniques.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/selection-sort\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/selection-sort\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/selection-sort\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/TV-selection-sort-in-DS.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/TV-selection-sort-in-DS.jpg","width":1200,"height":628,"caption":"Selection sort in DS"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/selection-sort\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Selection Sort in Data Structure"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/82098","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=82098"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/82098\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/82943"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=82098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=82098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=82098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}