C++ Programming Tutorial

 
 
 

Data File Structure Programs

Array

Insert, edit, delete, append, display, Srch. Insert, delete, merge, delete multiple occurrences Arrays as a Stack in graphics

Stack

Stack operations using array Stack using static memory allocation Stack using dynamic memory allocation Double ended link list as a stack Lnked list as a Stack Infix expr. to Postfix expr. Postfix expr. into an Infix expr. Arrays as a Stack in graphics Stack as an Arithmetic expr. Evaluater Graphical Rep. of Stack Stack to traverse - inodr, postodr, preodr

Queue

Queue using static memory allocation Queue using dynamic memory allocation Circular queue Linked list as a Queue Double Ended linked list as a Queue Graphical Rep. of Queue Arrays as a Linear Queue Array as a Circular Queue Arrays as a Linear Queue ( in graphics ) Arrays as a Circular Queue ( in graphics )

Linked List

Singly link list Circular linked list Doubly link list Linked list as a Queue Linked list as a Stack Double Ended linked list as a Queue Double Ended linked list as a Stack Infix to Postfix - Linked List as Stack Circular doubly link list Single Ended Linked List - Sorting in both odr Hashing - double ended Linked List Sort of link list

Tree

Linked List as a Binary Srch. Tree Set Class using Binary Srch. Tree Maximum depth of Binary Srch. Tree Minimum Spaning Tree Prims algo - minimum spanning tree Traverse binary tree - inodr, preodr, post Find number in binary Srch. tree display levell

Sorting

Bubble Sort Selection Sort Insertion Sort Radix Sort Merge Sort Quick Sort Heap Sort Linear Sort Shell Sort Topological Sort

Searching

Linear Srch. or Sequential Srch. Binary Search Breadth First Search Traversal Depth First Search Traversal Shortest Path-Given Source-Destination-Dijkstras

Hashing

Simple implementation of Hashing Hashing using double-ended Linked List Hashing using Mid-Square Method Example of Hashing n term of the fibonacci series using recursion

Recursion

Factorial of the given number using recursion Mystery of Towers of Hanoi using recursion
 
 

Image

 # include <iostream.h>
 # include <conio.h>

 void selection_sort(long [],int);

 main( )

    {
       clrscr( );

       const int array_size=10;

       long array[array_size]={0};

       cout<<\"\\n ******************************************************************************\"<<endl;
       cout<<\" ******************************  Selection Sort  ******************************\"<<endl;
       cout<<\" ******************************************************************************\"<<endl;

       cout<<\"\\n * Array size = 10\"<<endl;
       cout<<\" * Data Type = long\"<<endl;

       gotoxy(1,24);
       cout<<\" ******************************************************************************\";
       gotoxy(1,25);
       cout<<\" ******************************************************************************\";

       gotoxy(1,10);
       cout<<\" Enter the array : \"<<endl<<endl;

       for(int count_1=0;count_1<array_size;count_1++)
      {
         cout<<\"\\t Element[\"<<count_1<<\"] = \";
         cin>>array[count_1];
      }

       selection_sort(array,array_size);

       gotoxy(40,10);
       cout<<\" Sorted Array : \";

       for(int count_2=0;count_2<array_size;count_2++)
      {
         gotoxy(50,12+count_2);
         cout<<\"Element[\"<<count_2<<\"] = \"<<array[count_2]<<endl;
      }

       getch( );
       return 0;

    }


 //--------------------  selection_sort(long[],int)  ---------------------//


 void selection_sort(long array[],int array_size)
    {
       for(int count_1=0;count_1<array_size-1;count_1++)
      {
         int element=array[count_1];

         for(int count_2=count_1+1;count_2<=array_size-1;count_2++)
        {
           if(element>array[count_2])
              {
             long temp=element;

             element=array[count_2];
             array[count_2]=temp;
              }
        }

         array[count_1]=element;
      }
    }

    Related Post:
  1. Program to show the implementation of None-or-All String Clipping Strategy (Text Clipping Example)

  2. Program of singly link list

  3. Program to perform operator overloading converting one class object to another

  4. Program to illustrate the implementation of 3D Rotation Transformation along z-axis

  5. Write a Program to create Numeric Triangle

  6. Program to estimate the Integral value of the function at the given points from the given data using Trapezoidal Rule

  7. Program to illustrate the implementation of Y-Direction Shear Transformation

  8. Program to swap two integers

  9. Program of Graphical Representation of Stack And Queue

  10. Program to draw a spiral rotating clockwise at the center of the screen

  11. Program that provides an example of function returning object

  12. Program that provides an example of This pointer

  13. Program to illustrate the binary operator(-) overloading by creating an object of that class

  14. PROGRAM FOR ACCEPTING MEASUREMENTS IN METERS AND FEETS AND SUMMING THEM UP IN THE FORMAT THAT THE USER WISHES

  15. Program to get possible prime numbers like number 6158 contains the substrings 6, 1, 5, 8, 61, 15, 58, 615, 158, and 6158.Find the largest substring..

  16. Program to count number of words, lines and characters in given string

  17. Program to print a histogram

  18. Program to computes the n_th term of the fibonacci series using Divide and Conquer Strategy

  19. Program to illustrate the use of nested structures

  20. Program to estimate the Differential value of a given function using Trapezoidal Rule [Predictor-Corrector Scheme (PC2)]

 
 
Didn't find what you were looking for? Find more on Program to illustrate the Selection Sort