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
 
 
#include<iostream.h>
#include<stdio.h>
#include<conio.h>

main()
{
    int array[15];
    int no_el;
    clrscr();
    cout<<\"Enter the no of element :\";
    cin>>no_el;
    for(int i=0;i<no_el;i++)
    {
        cout<<\"Enter the element : \";
        cin>>array[i];
    }
    while(1)
    {
        clrscr();
        cout<<endl<<\"1. Append\";
        cout<<endl<<\"2. Insert\";
        cout<<endl<<\"3. delete by value\";
        cout<<endl<<\"4. edit\";
        cout<<endl<<\"5. display\";
        cout<<endl<<\"6. search\";
        cout<<endl<<\"7. exit\";
        cout<<endl<<\"Enter your choice : \";
        int choice;
        cin>>choice;
        switch(choice)
        {
            case 1:
                cout<<\"Enter the new element : \";
                int new_el;
                cin>>new_el;
                array[no_el]=new_el;
                no_el++;
            break;
            case 2:
                cout<<\"Enter the position at which you want to insert : \";
                int pos;
                cin>>pos;
                cout<<\"Enter the new element : \";
                cin>>new_el;
                pos--;
                for(i=no_el-1;i>=pos;i--)
                    array[i+1]=array[i];
                array[pos]=new_el;
                no_el++;
            break;
            case 3:
                cout<<\"Enter the value to be search : \";
                int key;
                cin>>key;
                for(pos=0;pos<no_el;pos++)
                {
                    if(array[pos]==key)
                        break;
                }
                if(pos==no_el)
                {
                    cout<<\"Search key not found\";
                    break;
                }
                for(i=pos;i<no_el;i++)
                    array[i]=array[i+1];
                no_el--;
            break;
            case 4:
                cout<<\"Enter the position to be edit : \";
                cin>>pos;
                cout<<\"Enter the new value for old position : \";
                cin>>array[pos-1];
            break;
            case 5:
                cout<<endl;
                for(i=0;i<no_el;i++)
                    cout<<endl<<\"The element is : \"<<array[i];
            break;
            case 6:
                cout<<\"Enter the value to be search : \";
                cin>>key;
                for(pos=0;pos<no_el;pos++)
                {
                    if(array[pos]==key)
                        break;
                }
                if(pos==no_el)
                {
                    cout<<\"Search key not found\";
                    break;
                }
                cout<<\"Search key found at : \"<<pos+1;
            break;
            case 7:
                return(0);
            break;
        }
        getch();
    }
}

    Related Post:
  1. Program to read a Non-Linear equation in one variable, then evaluate it using Secant Method and display its kD accurate root

  2. Program to create a queue using static memory allocation

  3. program to create a doubly link list

  4. Program to illustrate an example of Inheritance

  5. Example of Date

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

  7. Program to solve the mystery of Towers of Hanoi using recursion

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

  9. Program of Shortest Path for Given Source and Destination (using Dijkstras Algo.)

  10. Program that defines template of vector class that provides modify and multiplication facility

  11. Program to read a Linear System of Equations,then evaluate it by using Jacobis Itrative Method and show the result

  12. Program that provides an example of static variables in class

  13. Program that creats a 3D solid object using Translational Sweep Representatiom Method

  14. PROGRAM THAT PROVIDES AN EXAMPLE OF GETLINE FUNCTION

  15. Program that provides an example of passing structure as parameter using call by reference

  16. Program to implement the Prims Algorithm to solve Minimum Spanning Tree Problem (MST) using Graphics and with Mouse support

  17. Program to create a circular queue

  18. Program to draw a 3D Cubic Bezier Curve

  19. CREATING A LIST OF THE BOOKS AND THEIR DETAILS AND ACCEPTING DETAILS FROM THE CUSTOMER AND SEARCHING THE BOOKS

  20. Scanner of valide variable name in c