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

//Shell Sort

#include <iostream.h>
#include <conio.h>
#define MAX 10

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

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

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

void shellsort :: sortLogic(){
    int i,j,temp,increment;

    for(increment=n/2; increment>0; increment /= 2){
        for(i=increment; i<n; i++){
            temp=arr[i];
            for(j=i; j>=increment; j -= increment){
                if(temp < arr[j-increment])
                    arr[j] = arr[j-increment];
                else
                    break;
            }
            arr[j] = temp;
        }
    }
}

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

    Related Post:
  1. Program to illustrate the use of parameterless function

  2. Program of scaling about origin

  3. Program to draw different kinds of Dashed Lines

  4. Program to print a histogram

  5. Program to create queue / fifo using dynamic memory allocation

  6. Program to construct and display the Divided Difference Table from the given distinct data points.

  7. PROGRAM TO IMPLEMENT RECURSIVE DESCENT PARSER

  8. Program to illusrate data conversion b/w built-in data types

  9. Program to write macro that obtains the largest of three numbers

  10. Program of Deterministic Finite Automation (DFA) for identifier, real number with optional Integer and Fractional Part

  11. Program to estimate the value of Third Derivative of the function at the given points from the given data using Central Difference Formula of order 2

  12. Program that takes input of students and result obtained, based on that provides rank

  13. Program that reads marks obtained by a student in a test of 100 marks and print pass if marks are greater than or equal to 50

  14. Program to estimate the value of Second Derivative of the function at the given points from the given data using Central Difference Formula order 4

  15. Program to print some text

  16. Program to add two integers without using + operator

  17. Program to read a Non-Linear equation in one variable, then evaluate it using Modified False-Position Method and display its kD accurate root

  18. Program to estimate the Integral value of a given function using Gussian Quadrature Rule

  19. Program to estimate the value of Second Derivative of the function at the given points from the given data using Central Difference Formula of order 2

  20. Program to construct Clamped Cubic Spline Interpolant from the given data

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