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 of Binary Search Tree Operations

  2. Represent a polynomial in terms of a singly linked list and then add two three variables polynomials

  3. Program to read a Linear System of Equations,then evaluate it by using Guass-Seidel Itrative Method and show the result

  4. Program to implement the Prims Algorithm to solve Minimum Spanning Tree Problem (MST) using Graphics

  5. Program to create and display link list

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

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

  8. PROGRAM THAT PROVIDES AN EXAMPLE OF GETLINE FUNCTION

  9. Program that list of letters should be an alphabetical list of upper case letters followed by an alphabetical list of lower case letters

  10. Program that performs SCANNING of the following program and finds the entire float,integer variables and keywords present in the program

  11. Program to illustrate the Merge Sort

  12. Scanner of valide variable name in c

  13. Program to capitalize the first charcter of every word in a string

  14. 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 4

  15. Program to print a histogram

  16. Program that takes input of 2 matrix rows and columns data and displays addition of it using + operator overloading

  17. Program that displays checkbox like windows

  18. Program to illustrate use of arrays as data items in classes

  19. Program for converting int to class object

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