{"id":122895,"date":"2020-05-01T09:56:59","date_gmt":"2020-05-01T09:56:59","guid":{"rendered":"https:\/\/www.softwaretestinghelp.com\/?page_id=122895"},"modified":"2025-04-01T08:30:35","modified_gmt":"2025-04-01T08:30:35","slug":"selection-sort-java","status":"publish","type":"page","link":"https:\/\/www.softwaretestinghelp.com\/selection-sort-java\/","title":{"rendered":"Selection Sort In Java &#8211; Selection Sort Algorithm &#038; Examples"},"content":{"rendered":"<p><strong>This Tutorial will Explain all about Selection Sort In Java along with Selection Sort Algorithm, Java Code, Implementation in Java and Java Examples:<\/strong><\/p>\n<p>The selection sort technique is a method in which the smallest element in the array is selected and swapped with the first element of the array. Next, the second smallest element in the array is exchanged with the second element and vice versa.<\/p>\n<p><strong>=&gt; <a href=\"https:\/\/www.softwaretestinghelp.com\/java\/\">Check Here To See A-Z Of Java Training Tutorials Here.<\/a><\/strong><\/p>\n<p><em><strong> <\/strong><\/em><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Selection-sort-in-Java.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-123029\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Selection-sort-in-Java.png\" alt=\"Selection sort in Java\" width=\"650\" height=\"366\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Selection-sort-in-Java.png 650w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Selection-sort-in-Java-300x169.png 300w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<h2>Selection Sort In Java<\/h2>\n<p>This way the smallest element in the array is selected repeatedly and put in its proper position until the entire array is sorted.<\/p>\n<p><strong>Two sub-arrays are maintained for selection sort:<\/strong><\/p>\n<ol>\n<li><strong>Sorted sub-array:<\/strong> In every iteration, the minimum element is found and placed in its proper position. This sub-array is sorted.<\/li>\n<li><strong>Unsorted sub-array:<\/strong> The remaining elements that are not sorted.<\/li>\n<\/ol>\n<p>The selection sort is a straightforward and easy sorting technique. The technique only involves finding the smallest element in every pass and placing it in the correct position. The selection sort is ideal for smaller data sets as it sorts the smaller dataset efficiently.<\/p>\n<p>Thus we can say selection sort is not advisable for larger lists of data.<\/p>\n<h3>Selection Sort Algorithm<\/h3>\n<p><strong>The General Algorithm for Selection Sort is given below:<\/strong><\/p>\n<p><span style=\"color: #ff6600;\"><strong>Selection Sort (A, N)<\/strong><\/span><\/p>\n<p><strong>Step 1<\/strong>: Repeat Steps 2 and 3 for K = 1 to N-1<\/p>\n<p><strong>Step 2<\/strong>: Call routine smallest(A, K, N, POS)<\/p>\n<p><strong>Step 3<\/strong>:<\/p>\n<p>Swap A[K] with A [POS]<br \/>\n[End of loop]<\/p>\n<p><strong>Step 4<\/strong>: EXIT<\/p>\n<p><span style=\"color: #ff6600;\"><strong>Routine smallest (A, K, N, POS)<\/strong><\/span><\/p>\n<p><strong>Step 1<\/strong>: [initialize] set smallestItem = A[K]<\/p>\n<p><strong>Step 2<\/strong>: [initialize] set POS = K<\/p>\n<p><strong>Step 3<\/strong>:<\/p>\n<p>for J = K+1 to N -1, repeat<br \/>\nif smallestItem &gt; A [J]<br \/>\nset smallestItem = A [J]<br \/>\nset POS = J<br \/>\n[if end]<br \/>\n[End of loop]<\/p>\n<p><strong>Step 4<\/strong>: return POS<\/p>\n<p>As you can see, the routine to find the smallest number is called while traversing the data set. Once the smallest element is found, it is placed in its desired position.<\/p>\n<h3>Pseudocode For Selection Sort<\/h3>\n<p><strong>The pseudo-code for the selection sort algorithm is given below.<\/strong><\/p>\n<pre>Procedure selection_sort(array,N)\r\n\tarray \u2013 array of items to be sorted\r\n\tN \u2013 size of array\r\nbegin\r\n\tfor I = 1 to N-1\r\n\tbegin\r\n\t\tset min  = i\r\n\t\tfor j = i+1 to N\r\n\t\tbegin\r\n\t\t\tif array[j] &lt; array[min] then\r\n\t\t\t\tmin = j;\r\n\t\t\tend if\r\n\t\tend for\r\n\t\t\/\/swap the minimum element with current element\r\n\t\tif minelem != I then\r\n\t\t\tswap array[min[] and array[i]\r\n\t\tend if\r\n\tend for\r\nend procedure<\/pre>\n<p>Let us now illustrate the sorting of an array using selection sort.<\/p>\n<h3>Selection Sort Example<\/h3>\n<p><span style=\"text-decoration: underline;\"><strong>Consider the following array that is to be sorted as an example of a selection sort.<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Selection-sort-example.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-122978\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Selection-sort-example.png\" alt=\"Selection sort example\" width=\"335\" height=\"84\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Selection-sort-example.png 335w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Selection-sort-example-300x75.png 300w\" sizes=\"(max-width: 335px) 100vw, 335px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass1-1.png\"><img decoding=\"async\" class=\"alignnone wp-image-122974 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass1-1.png\" alt=\"Pass 1\" width=\"511\" height=\"635\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass1-1.png 511w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass1-1-241x300.png 241w\" sizes=\"(max-width: 511px) 100vw, 511px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass2-1.png\"><img decoding=\"async\" class=\"alignnone wp-image-122975 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass2-1.png\" alt=\"Pass 2\" width=\"572\" height=\"470\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass2-1.png 572w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass2-1-300x247.png 300w\" sizes=\"(max-width: 572px) 100vw, 572px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass3.png\"><img decoding=\"async\" class=\"alignnone wp-image-122976 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass3.png\" alt=\"Pass 3\" width=\"568\" height=\"377\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass3.png 568w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass3-300x199.png 300w\" sizes=\"(max-width: 568px) 100vw, 568px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass4.png\"><img decoding=\"async\" class=\"alignnone wp-image-122977 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass4.png\" alt=\"Pass 4\" width=\"500\" height=\"235\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass4.png 500w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Pass4-300x141.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p><strong>Given below is a tabular representation for the illustration:<\/strong><\/p>\n\n<div id=\"tablepress-1331-scroll-wrapper\" class=\"tablepress-scroll-wrapper\">\n<table id=\"tablepress-1331\" class=\"tablepress tablepress-id-1331 tablepress-responsive\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Unsorted list<\/th><th class=\"column-2\">Least element<\/th><th class=\"column-3\">Sorted list<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">{17,10,7,29,2}<\/td><td class=\"column-2\">2<\/td><td class=\"column-3\">{}<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">{17,10,7,29}<\/td><td class=\"column-2\">7<\/td><td class=\"column-3\">{2}<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">{17,10,29}<\/td><td class=\"column-2\">10<\/td><td class=\"column-3\">{2,7}<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">{17,29}<\/td><td class=\"column-2\">17<\/td><td class=\"column-3\">{2,7,10)<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">{29}<\/td><td class=\"column-2\">29<\/td><td class=\"column-3\">{2,7,10,17}<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">{}<\/td><td class=\"column-2\"><\/td><td class=\"column-3\">{2,7,10,17,29}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<!-- #tablepress-1331 from cache -->\n<p>From the illustration, we see that with every pass the next smallest element is put in its correct position in the sorted array. In general, to sort an array of N elements, we need N-1 passes in total.<\/p>\n<h3>Selection Sort Implementation In Java<\/h3>\n<p><strong>Let&#8217;s now demonstrate the Java program to implement selection sort.<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">import java.util.*;\r\nclass Main \r\n{ \r\n    static void sel_sort(int numArray&#x5B;]) \r\n    { \r\n        int n = numArray.length; \r\n  \r\n        \/\/ traverse unsorted array \r\n        for (int i = 0; i &lt; n-1; i++) \r\n        { \r\n            \/\/ Find the minimum element in unsorted array \r\n            int min_idx = i; \r\n            for (int j = i+1; j &lt; n; j++) \r\n                if (numArray&#x5B;j] &lt; numArray&#x5B;min_idx]) \r\n                    min_idx = j; \r\n  \r\n            \/\/ swap minimum element with compared element  \r\n            int temp = numArray&#x5B;min_idx]; \r\n            numArray&#x5B;min_idx] = numArray&#x5B;i]; \r\n            numArray&#x5B;i] = temp; \r\n        } \r\n    } \r\n  \r\n    public static void main(String args&#x5B;]) \r\n    { \r\n        \/\/declare and print the original array\r\n        int numArray&#x5B;] = {7,5,2,20,42,15,23,34,10};\r\n        System.out.println(&quot;Original Array:&quot; + Arrays.toString(numArray)); \r\n        \/\/call selection sort routine\r\n        sel_sort(numArray); \r\n        \/\/print the sorted array\r\n        System.out.println(&quot;Sorted Array:&quot; + Arrays.toString(numArray)); \r\n    } \r\n} \r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Original Array:[7, 5, 2, 20, 42, 15, 23, 34, 10]<br \/>\nSorted Array:[2, 5, 7, 10, 15, 20, 23, 34, 42]<\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Java-program-to-implement-selection-sort.png\"><img decoding=\"async\" class=\"alignnone wp-image-122980 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Java-program-to-implement-selection-sort.png\" alt=\"Output - Java program to implement selection sort\" width=\"374\" height=\"52\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Java-program-to-implement-selection-sort.png 374w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Java-program-to-implement-selection-sort-300x42.png 300w\" sizes=\"(max-width: 374px) 100vw, 374px\" \/><\/a><\/p>\n<p>In the above java example, we repeatedly find the smallest element in the array and put it in the sorted array until the entire array is completely sorted.<\/p>\n<h3>Selection Sort Linked List In Java<\/h3>\n<p>Given below is a linked list and we have to sort it using selection sort. To do this we will use the recursive approach of selection sort. Instead of swapping the data part of the node, we will swap the nodes and realign the pointers.<\/p>\n<p><strong>So if the linked list is given as follows:<\/strong><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/output-of-the-program-to-sort-the-linked-list.png\"><img decoding=\"async\" class=\"alignnone wp-image-122973 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/output-of-the-program-to-sort-the-linked-list.png\" alt=\"linked list\" width=\"568\" height=\"83\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/output-of-the-program-to-sort-the-linked-list.png 568w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/output-of-the-program-to-sort-the-linked-list-300x44.png 300w\" sizes=\"(max-width: 568px) 100vw, 568px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/linked-list.png\"><img decoding=\"async\" class=\"alignnone wp-image-122972 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/linked-list.png\" alt=\"linked list - 2\" width=\"564\" height=\"98\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/linked-list.png 564w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/linked-list-300x52.png 300w\" sizes=\"(max-width: 564px) 100vw, 564px\" \/><\/a><\/p>\n<p><strong>Given below is the Java program that implements the above sorting.<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\/\/ add a node to the beginning of the linked list \r\nstatic Node addNode( Node head_ref, int new_data)  \r\n{  \r\n    \/\/ create a node  \r\n    Node newNode = new Node();  \r\n  \r\n    \/\/ assign data to node  \r\n    newNode.data = new_data;  \r\n  \r\n    \/\/ link the node to linked list \r\n    newNode.next = (head_ref);  \r\n  \r\n    \/\/head now points to new node  \r\n    (head_ref) = newNode;  \r\n    return head_ref; \r\n}  \r\n\/\/ method to swap nodes  \r\nstatic Node swapNodes( Node head_ref, Node curr_node1,  Node curr_node2, Node prev_node) {  \r\n    \/\/ curr_node2 is new head \r\n    head_ref = curr_node2;  \r\n    \/\/ realign links\r\n    prev_node.next = curr_node1;  \r\n  \r\n    \/\/ now swap next pointers of nodes  \r\n    Node temp = curr_node2.next;  \r\n    curr_node2.next = curr_node1.next;  \r\n    curr_node1.next = temp;  \r\n    return head_ref; \r\n}  \r\n  \r\n\/\/ sort the linked list using selection sort  \r\nstatic Node Selection_Sort( Node head) {  \r\n    \/\/ only a single node in linked list  \r\n    if (head.next == null)  \r\n        return head;  \r\n  \r\n    \/\/ minNode =&gt; node with minimum data value  \r\n    Node minNode = head;  \r\n  \r\n    \/\/ prevMin =&gt; node previous to minNode \r\n    Node prevMin = null;  \r\n    Node ptr;  \r\n  \r\n    \/\/ traverse the list from head to last node  \r\n    for (ptr = head; ptr.next != null; ptr = ptr.next)   {  \r\n          \/\/ check if current node is minimum \r\n        if (ptr.next.data &lt; minNode.data)   {  \r\n            minNode = ptr.next;  \r\n            prevMin = ptr;  \r\n        }  \r\n    }  \r\n    \/\/ minimum node becomes head now\r\n    if (minNode != head)  \r\n        head = swapNodes(head, head, minNode, prevMin);  \r\n  \r\n    \/\/ sort remaning list recursively  \r\n    head.next = Selection_Sort(head.next);  \r\n  \r\n    return head;  \r\n}  \r\n\/\/ sort the given linked list  \r\nstatic Node sort( Node head_ref)  \r\n{  \r\n    \/\/ linked list is empty  \r\n    if ((head_ref) == null)  \r\n        return null;  \r\n  \r\n    \/\/ call Selection_Sort method to sort the linked list  \r\n    head_ref = Selection_Sort(head_ref);  \r\n    return head_ref; \r\n}  \r\n  \r\n\/\/ print nodes of linked list  \r\nstatic void printList( Node head)  \r\n{  \r\n    while (head != null)  \r\n    {  \r\n        System.out.print( head.data + &quot; &quot;);  \r\n        head = head.next;  \r\n    }  \r\n}  \r\n  \r\npublic static void main(String args&#x5B;]) \r\n{  \r\n    Node oddList = null;  \r\n  \r\n    \/\/ create linked list using addNode method  \r\n    oddList = addNode(oddList, 11);  \r\n    oddList = addNode(oddList, 1);  \r\n    oddList = addNode(oddList, 5);  \r\n    oddList = addNode(oddList, 3);  \r\n    oddList = addNode(oddList, 9); \r\n    oddList = addNode(oddList, 7);\r\n    \/\/print the original list\r\n    System.out.println( &quot;Original Linked list:&quot;);  \r\n    printList(oddList);  \r\n  \r\n    \/\/ sort the linked list  \r\n    oddList = sort(oddList);  \r\n  \r\n    \/\/print the sorted list\r\n    System.out.println( &quot;\\nLinked list after sorting:&quot;);  \r\n    printList(oddList);  \r\n}  \r\n}  \r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Original Linked list:<br \/>\n7 9 3 5 1 11<br \/>\nLinked list after sorting:<br \/>\n1 3 5 7 9 11<\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Java-program-that-implements-the-above-sorting1.png\"><img decoding=\"async\" class=\"alignnone wp-image-122982 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/03\/Java-program-that-implements-the-above-sorting1.png\" alt=\"Implementing Java Sort - Output\" width=\"207\" height=\"103\" \/><\/a><\/p>\n<p>Note that in the above program, we have realigned links of the nodes instead of sorting only the data component of the node.<\/p>\n<h3>Frequently Asked Questions<\/h3>\n<p><span style=\"color: #ff6600;\"><strong>Q #1) How does Selection sort work?<\/strong><\/span><\/p>\n<p><strong>Answer:<\/strong> Selection sort works by maintaining two sub-arrays. The minimum element from the unsorted subarray is placed in its proper position in a sorted sub-array. Then the second-lowest element is placed in its proper position. This way, the entire array is sorted by selecting a minimum element during each iteration.<\/p>\n<p><span style=\"color: #ff6600;\"><strong>Q #2<span style=\"color: #ff6600;\">) <\/span><\/strong><strong>What is the complexity of the Selection sort?<\/strong><\/span><\/p>\n<p><strong>Answer:<\/strong> The overall complexity of selection sort is O (n<sup>2<\/sup>), thereby making it the algorithm that is inefficient on larger data sets. Other sorting techniques are more efficient.<\/p>\n<p><span style=\"color: #ff6600;\"><strong>Q #3<span style=\"color: #ff6600;\">) <\/span><\/strong><strong>What are the Advantages and Disadvantages of Selection sort?<\/strong><\/span><\/p>\n<p><strong>Answer:<\/strong> Selection sort is the in-place sorting technique and thus it does not require additional storage to store intermediate elements.<\/p>\n<p>It works efficiently on smaller data structures as well as the data sets that are almost sorted.<\/p>\n<p>The major disadvantage of the selection sort technique is that it performs very poorly as the size of the data structure increases. It not only becomes slower but also decreases efficiency.<\/p>\n<p><span style=\"color: #ff6600;\"><strong>Q #4<span style=\"color: #ff6600;\">) <\/span><\/strong><strong>How many swaps are there in the Selection sort?<\/strong><\/span><\/p>\n<p><strong>Answer:<\/strong> The selection sort technique takes the minimum number of swaps. For the best case, when the array is sorted, the number of swaps in the selection sort is 0.<\/p>\n<p><span style=\"color: #ff6600;\"><strong>Q #5<span style=\"color: #ff6600;\">) <\/span><\/strong><strong>Is selection sort faster than Insertion sort?<\/strong><\/span><\/p>\n<p><strong>Answer:<\/strong> Insertion sort is faster and more efficient as well as stable. Selection sort is faster only for smaller data sets and partially sorted structures.<\/p>\n<h2>Conclusion<\/h2>\n<p>Selection sort is a technique that works by selecting the minimum element while traversing the array. For each pass\/iteration, the next minimum element in the data set is selected and placed in its proper position.<\/p>\n<p>The selection sort technique works efficiently when the number of elements in the data set is smaller, but it starts to perform poorly as the size of the data set grows. It becomes inefficient when compared to the other similar techniques like insertion sort.<\/p>\n<p><em><strong>In this tutorial, we have implemented examples to sort arrays and linked lists using selection sort.\u00a0<\/strong><\/em><\/p>\n<p><strong>=&gt; <a href=\"https:\/\/www.softwaretestinghelp.com\/java\/\">Visit Here To See The Java Training Series For All.<\/a><\/strong><\/p>\n\r\n\t\t\t<div id=\"daexthefup-container\"\r\n\t\t\t\tclass=\"daexthefup-container daexthefup-layout-stacked daexthefup-alignment-center\"\r\n\t\t\t\tdata-post-id=\"122895\">\r\n\r\n\t\t\t\t<div class=\"daexthefup-feedback\">\r\n\t\t\t\t\t<div class=\"daexthefup-text\">\r\n\t\t\t\t\t\t<h3 class=\"daexthefup-title\">Was this helpful?<\/h3>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div class=\"daexthefup-buttons-container\">\r\n\t\t\t\t\t\t<div class=\"daexthefup-buttons\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t<div class=\"daexthefup-yes daexthefup-button daexthefup-button-type-icon\" data-value=\"1\">\r\n\t\t\t\t\r\n                <svg>\r\n                    <defs>\r\n                        <style>.thumb-up-cls-1{fill:#c9c9c9;}.thumb-up-cls-2{fill:#e1e1e1;}.thumb-up-cls-3{fill:#676767;}<\/style>\r\n                    <\/defs>\r\n                    <g id=\"thumb_up\">\r\n                        <path class=\"thumb-up-cls-2 daexthefup-icon-circle\" d=\"m24,3c11.58,0,21,9.42,21,21s-9.42,21-21,21S3,35.58,3,24,12.42,3,24,3m0-1C11.85,2,2,11.85,2,24s9.85,22,22,22,22-9.85,22-22S36.15,2,24,2h0Z\" \/>\r\n                        <g>\r\n                            <rect class=\"thumb-up-cls-3 daexthefup-icon-secondary-color\" x=\"10\" y=\"20\" width=\"6\" height=\"15\" rx=\"1.5\" ry=\"1.5\" \/>\r\n                            <path class=\"thumb-up-cls-1 daexthefup-icon-primary-color\" d=\"m30.57,9.06l-.49-.1c-.81-.17-1.61.35-1.78,1.16l-5.3,11.74c-.17.81,3.16,1.61,3.97,1.78l1.96.41c.81.17,1.61-.35,1.78-1.16l2.18-10.27c.34-1.61-.7-3.21-2.31-3.56Z\" \/>\r\n                            <path class=\"thumb-up-cls-1 daexthefup-icon-primary-color\" d=\"m38.17,20h-18.67c-.83,0-1.5.67-1.5,1.5v12c0,.83.67,1.5,1.5,1.5h16.27c.71,0,1.33-.5,1.47-1.21l2.4-12c.19-.93-.53-1.8-1.47-1.8Z\" \/>\r\n                        <\/g>\r\n                    <\/g>\r\n                <\/svg>\t\t\t<\/div>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t<div class=\"daexthefup-no daexthefup-button daexthefup-button-type-icon\" data-value=\"0\">\r\n\t\t\t\t\r\n                <svg>\r\n                    <defs>\r\n                        <style>.thumb-down-cls-1{fill:#c9c9c9;}.thumb-down-cls-2{fill:#e1e1e1;}.thumb-down-cls-3{fill:#676767;}<\/style>\r\n                    <\/defs>\r\n                    <g id=\"thumb_down\">\r\n                        <path class=\"thumb-down-cls-2 daexthefup-icon-circle\" d=\"m24,3c11.58,0,21,9.42,21,21s-9.42,21-21,21S3,35.58,3,24,12.42,3,24,3m0-1C11.85,2,2,11.85,2,24s9.85,22,22,22,22-9.85,22-22S36.15,2,24,2h0Z\" \/>\r\n                        <g>\r\n                            <rect class=\"thumb-down-cls-3 daexthefup-icon-secondary-color\" x=\"10\" y=\"13\" width=\"6\" height=\"15\" rx=\"1.5\" ry=\"1.5\" \/>\r\n                            <path class=\"thumb-down-cls-1 daexthefup-icon-primary-color\" d=\"m30.57,38.94l-.49.1c-.81.17-1.61-.35-1.78-1.16l-5.3-11.74c-.17-.81,3.16-1.61,3.97-1.78l1.96-.41c.81-.17,1.61.35,1.78,1.16l2.18,10.27c.34,1.61-.7,3.21-2.31,3.56Z\" \/>\r\n                            <path class=\"thumb-down-cls-1 daexthefup-icon-primary-color\" d=\"m38.17,28h-18.67c-.83,0-1.5-.67-1.5-1.5v-12c0-.83.67-1.5,1.5-1.5h16.27c.71,0,1.33.5,1.47,1.21l2.4,12c.19.93-.53,1.8-1.47,1.8Z\" \/>\r\n                        <\/g>\r\n                    <\/g>\r\n                <\/svg>\t\t\t<\/div>\r\n\r\n\t\t\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\r\n\t\t\t\t<div class=\"daexthefup-comment\">\r\n\t\t\t\t\t<div class=\"daexthefup-comment-top-container\">\r\n\t\t\t\t\t\t<label id=\"daexthefup-comment-label\" class=\"daexthefup-comment-label\"><\/label>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"daexthefup-comment-character-counter-container\">\r\n\t\t\t\t\t\t\t\t<div id=\"daexthefup-comment-character-counter-number\"\r\n\t\t\t\t\t\t\t\t\tclass=\"daexthefup-comment-character-counter-number\"><\/div>\r\n\t\t\t\t\t\t\t\t<div class=\"daexthefup-comment-character-counter-text\"><\/div>\r\n\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<textarea id=\"daexthefup-comment-textarea\" class=\"daexthefup-comment-textarea\"\r\n\t\t\t\t\t\t\t\tplaceholder=\"Type your message\"\r\n\t\t\t\t\t\t\t\tmaxlength=\"\r\n\t\t\t\t\t\t\t\t400\t\t\t\t\t\t\t\t\t\"><\/textarea>\r\n\t\t\t\t\t<div class=\"daexthefup-comment-buttons-container\">\r\n\t\t\t\t\t\t<button class=\"daexthefup-comment-submit daexthefup-button\">Submit<\/button>\r\n\t\t\t\t\t\t<button class=\"daexthefup-comment-cancel daexthefup-button\">Cancel<\/button>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\r\n\t\t\t\t<div class=\"daexthefup-successful-submission-text\">Thanks for your feedback!<\/div>\r\n\r\n\t\t\t<\/div>\r\n\r\n\t\t\t","protected":false},"excerpt":{"rendered":"<p>This Tutorial will Explain all about Selection Sort In Java along with Selection Sort Algorithm, Java Code, Implementation in Java and Java Examples: The selection sort technique is a method in which the smallest element in the array is selected and swapped with the first element of the array. Next, &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Selection Sort In Java &#8211; Selection Sort Algorithm &#038; Examples\" class=\"read-more button\" href=\"https:\/\/www.softwaretestinghelp.com\/selection-sort-java\/#more-122895\" aria-label=\"Read more about Selection Sort In Java &#8211; Selection Sort Algorithm &#038; Examples\">Read more<\/a><\/p>\n","protected":false},"author":9,"featured_media":123029,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_helpful_pro_status":1,"footnotes":""},"categories":[408],"tags":[],"class_list":{"0":"post-122895","1":"page","2":"type-page","3":"status-publish","4":"has-post-thumbnail","6":"category-java"},"acf":[],"_links":{"self":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages\/122895","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/comments?post=122895"}],"version-history":[{"count":0,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages\/122895\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/media\/123029"}],"wp:attachment":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/media?parent=122895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/categories?post=122895"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/tags?post=122895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}