top of page
Search
The Tech Platform
Nov 2, 2020
Selection Sort Program in Java
class SelectionSort { void swap(int A[], int i, int j) { int temp = A[i]; A[i] = A[j]; A[j] = temp; } int findMinIndex(int A[], int...
The Tech Platform
Nov 2, 2020
Selection sort program in C++:
#include <iostream> #include <vector> using namespace std; int findMinIndex(vector<int> &A, int start) { int min_index = start; ...
The Tech Platform
Nov 2, 2020
Selection sort program in C:
#include <stdio.h> void swap(int *A, int i, int j) { int temp = A[i]; A[i] = A[j]; A[j] = temp; } int findMinIndex(int *A, int start,...
The Tech Platform
Nov 2, 2020
Insertion Sort Algorithm
Insertion sort is a simple sorting algorithm that builds the final sorted array one element at a time. It is an in-place and stable...
The Tech Platform
Nov 2, 2020
Insertion Sort Implementation in Python
# Function to do insertion sort def insertionSort(arr): # Traverse through 1 to len(arr) for i in range(1, len(arr)): key = arr[i] # Move...
The Tech Platform
Nov 2, 2020
Insertion Sort Implementation in Java
public class InsertionSort { /*Function to sort array using insertion sort*/ void sort(int arr[]) { int n = arr.length; for (int i=1;...
The Tech Platform
Nov 2, 2020
Insertion Sort Implementation in C++
#include <stdlib.h> #include <iostream> using namespace std; //member functions declaration void insertionSort(int arr[], int length);...
The Tech Platform
Nov 2, 2020
Insertion Sort Implementation In C
#include <stdio.h> #include <stdbool.h> #define MAX 7 //defining size of our array int intArray[MAX] = {4,6,3,2,1,9,7}; void...
bottom of page