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>
#define MAX 10

class linsort{
    int arr[MAX],n;
    public:
    void getdata();
    void showdata();
    void sortLogic();
};

void linsort :: getdata(){
    cout<<\"How many elements you require : \";
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>arr[i];
}

void linsort :: showdata(){
    cout<<\"\\n--Display--\\n\";
    for(int i=0;i<n;i++)
        cout<<arr[i]<<\"   \";
}

void linsort :: sortLogic(){
    int temp;
    for(int i=0;i<n;i++){
        for(int j=i;j<n;j++){
            if(arr[i] > arr[j]){
                temp = arr[i];
                arr[i] = arr[j];
                arr[j] = temp;
                cout<<\"\\n arr[i] = \"<<arr[i]<<\"  arr[j] = \"<<arr[j];
            }
        }
        cout<<endl;
    }
}

void main(){
    clrscr();
    cout<<\"\\n*****Linear Sort*****\\n\";
    linsort obj;
    obj.getdata();
    obj.sortLogic();
    obj.showdata();
    getch();
}

    Related Post:
  1. Program to illustrate strings as member of classes

  2. Program to show the 3D Reflection Transformation along yz-plane

  3. Program to illustrate the use of call-by-refrence method using pointers

  4. Program for election contest among five candidates

  5. Program to interchange the values of two int , float and char using function overloading

  6. Program of Deapth First Search Traversal ( DFS )

  7. Program to help Umar in this task. Represent each city by one lowercase character. Thus, you can have at most 26 different cities to visit....

  8. Program that will allow a spy to encode and decode messages

  9. Program to show the implementation of Hashing with Insert, Delete and search functionality using double-ended Linked List

  10. Program to illustrate the implementation of Scaling Transformation along a Fixed Point

  11. Program illustrating operator overloading

  12. Program of time conversion using conversion functions

  13. Program to illusrate the use of stream insertion and extraction operators

  14. Write a program to read value from console and perform arithmetic operation

  15. FUNCTION WITH ALIAS NAME OR REFERENCE VARIABLE IN C++

  16. Program to find the value of sin at any given angle

  17. Program to perform radix sort

  18. Program to illustrate an example of Polymorphism ( Pure Virtual functions ).

  19. Develop a Toy Compiler, which takes a series of statements as input, and creates a symbol table from it

  20. Program to calculate distance summation, subtraction, multiplication and comparison using overloading operators also make it friend functions

 
 
Didn't find what you were looking for? Find more on Program to perform linear sort