Friday 30 March 2012

Visual Demonstration of the QuickSort Algorithm

0 comments
Quick sort is fastest sorting in Data structure. Algorithm is little bit difficult to understand by reading it.
Learning  Fundamental of every concept is best rather than only remember algorithm line by line, This  video tutorial teaches you basic funda of doing Quick Sort.

Everyone learns faster by seeing Visual Demonstration and this Demonstration allows you to do same. 


Thursday 29 March 2012

Queue Implementation using Array

0 comments

Write a program to perform the following operation on a simple queue ( using Array )
    a.    Insert an element
    b.    Remove an element
    c.    Display
#include<iostream.h>
#include<stdlib.h>
#include<conio.h>

class Queue
{
    int *que, F, R;
    int size;
public :
    Queue(int s)
    {
        F = R = -1;
        size = s;
        que = new int[size];
    }
    void insertElement(int); // insert element fucntion
    void display();
    void delElement();
};

void Queue :: insertElement(int element)
{
    if(R == (size - 1))
        cout<<endl<<"Queue is Full"<<endl;
    else
    {
        if(F == -1 )
            F = 0;
        R++;
        que[R] = element;
    }
}

void Queue :: delElement()
{
    if(F  == -1)
        cout<<endl<<"Queue is Empty";
    else
    {
        if(F == R)
        {
            F = R = -1;
        }
        else
        {
            int element = que[F];
            F++;
            cout<<endl<<"Deleted Element is : "<<element<<endl;
        }
    }
}
void Queue :: display()
{
    cout<<endl<<"\t\t\t";

    for(int i = F; i <= R; i++)
    {
        cout<<que[i]<<"  ";
    }
    cout<<endl;
}


void main()
{

    int ch, element, size;

    clrscr();
    cout<<endl<<"Queue OPERATION";

    cout<<endl<<"Enter Size for Queue: ";
    cin>>size;

    Queue q(size);        //object of queue class

    while(1)
    {

    cout<<endl<<" 1. Insert";
    cout<<endl<<" 2. delete";
    cout<<endl<<" 3. Exit"<<endl;
    cin>>ch;

    switch(ch)
    {
        case 1:
            cout<<endl<<"Enter Element: ";
            cin>>element;

            q.insertElement(element);

            q.display();
            break;
        case 2: q.delElement();
            q.display();
            break;
        case 3:
            exit(0);
        default:
            cout<<endl<<"wrong choice"<<endl;
    }

    }

getch();
}

Monday 26 March 2012

Stack implementation using Linked List

0 comments

1.    Write a program to perform the following operations on a stack.(using Linked List)
    a.    PUSH   
    b.    POP
    c.    ISEMPTY
    d.    ISFULL
    e.    PEEP
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
class node
{
    int data;    //data part of node
    node *link;  // link part points to next node
public:
    node()       // constructor that set NULL to link
    {
        link = NULL;
    }

//below are functions to get/set the private members
    int getData()
    {
        return data;
    }
    void setData(int d)
    {
        data = d;
    }
    node* getLink()
    {
        return link;
    }
    void setLink(node *nnode)
    {
        link = nnode;
    }
};

// stack class
class StackLL
{
    node *top;
public:
    StackLL()// set top to NULL
    {
        top = NULL;
    }
    void push(int);
    void pop();
    void peep();
    int isEmpty();
    void display();
};

//member function's body

void StackLL :: push(int element)
{
    node *nnode;
    nnode = new node;
    nnode->setData(element);
    if(isEmpty())
    {
        top = nnode;
    }
    else
    {
        nnode->setLink(top);
        top=nnode;
    }
}
int StackLL :: isEmpty()
{
    if(top == NULL)
        return 1;
    else
        return 0;
}

void StackLL :: pop()
{
    node *ptr;
    if(isEmpty())
    {
        cout<<endl<<"Stack Underflow";
    }
    else
    {
        ptr = top;
        top = top->getLink();
        delete(ptr);
    }
}

void StackLL :: display()
{
    node *ptr;
    cout<<endl<<"\t\t\t";
    for(ptr = top; ptr!=NULL; ptr=ptr->getLink())
    {
        cout<<ptr->getData()<<endl<<endl<<"\t\t\t";
    }
}


void main()
{
    int element, ch;
    clrscr();
    cout<<endl<<"\tStack Operation using LinkedList";
    StackLL stk;

    while(1)
    {
    cout<<endl<<" 1. Insert";
    cout<<endl<<" 2. delete";
    cout<<endl<<" 3. Exit"<<endl;

    cin>>ch;
    clrscr();
    cout<<endl<<"\t\t\tStack Operation using LinkedList"<<endl;

    switch(ch)
    {
        case 1:
            cout<<endl<<"Enter data: ";
            cin>>element;

            stk.push(element);

            stk.display();
            break;
        case 2: stk.pop();
            stk.display();
            break;
        case 3:
            exit(0);
        default:
            cout<<endl<<"wrong choice"<<endl;
    }

 }
getch();
}

Sunday 25 March 2012

Copyright Policy

0 comments

Copyright Policy

All pages, data and graphics presented on this website are the property of iAmLearningHere.blogspot.in

The pages may not be redistributed or reproduced in any way, shape, or form without mentioning proper reference of this site. In every redistribution or reproduce mention our site name ("iAmLearningHere.blogspot.in") in footer or at end of the content or in reference.

iAmLearningHere.blogspot.in respects the copyrights, trademarks and intellectual property of others and also we expect this from other users. In this site, if you found any information that is owned by you or any content that violates your intellectual property rights, please contact to us with all necessary documents/information that authenticate your authority on your property.

For all other policies, terms and conditions, please read our Terms of Service.

Terms of Use and Privacy Policy

TERMS OF SERVICE

1. ACCEPTANCE OF TERMS

iAmLearningHere.blogspot.in provides its service to you, subject to the following Terms of Service. These policies may be updated by us from time to time without notice of you. You can review our updated terms and conditions always in this page. Usage of this site is subject to these Terms, Conditions and Policies, therefore please read the following information carefully.

2. USAGE OF THIS SITE

iAmLearningHere.blogspot.in is an Open Database and operates with a motto of collecting and sharing questions,answers,study materials, ppt, docs and all language practicals that were created by our Team or submitted by our readers. This data is collected and submitted by various users/visitors around the world.
iAmLearningHere.blogspot.in does not guarantee the re-occurrences or repetition of post in same exam or any other competition. The purpose of this site is to provide information to the students.
Even though every care has been taken in compiling the information forwarded by certain enthusiastic users, iAmLearningHere.blogspot.in doesn’t guarantee the accuracy of the content or information that provided in this site and won’t take responsible for any INCORRECT questions, answers, material, documents, content and any form of errors.
iAmLearningHere.blogspot.in will not be responsible in anyway for any damages/consequences that might occur due to inclusion of some incorrect content or information in this site. You can use this information solely at your own risk.
Users submitting Material(doc, ppt, txt) or code to this site, asserts that he or she owns that data or otherwise has the right to redistribute it freely. iAmLearningHere.blogspot.in assumes no liability for disputes regarding ownership, copyright, or trademarks of the data submitted to this site.
iAmLearningHere.blogspot.in reserves the right to refuse to post any submission, to alter submissions, and to remove a submission from the site. iAmLearningHere.blogspot.in may exercise this right without any advance notice to the individual submitting the code or content.
This site it only for learning purpose, user can use our materials or code by giving reference back to our site.
All trademarks, logos and company names published in this site are subjected to their respected owners and companies.

3. REGISTRATION INTO SITE

This is NO registration service provided by iAmLearningHere now. Visitors can subscribe the site by email on their own interest, it is not mandatory. This subscription into the site permits the user to get all post in their mail inbox free.
The personal information that collected during this subscription process will NOT, be distributed and shared with any other third-parties. iAmLearningHere.blogspot.in NEVER verifies the accuracy of Personal Information that is submitted to the site, it is solely responsibility of the user.
iAmLearningHere.blogspot.in reserves the right to suspend or permanently delete any user, If the data or information provided by the user is inaccurate, not related or incomplete or if the user violated our terms and conditions in any manner.

4. ANTI-SPAM POLICY

iAmLearningHere.blogspot.in is against in sending spam, unsolicited emails. You should not use our service and you are not authorized to use our referral or email services, for your personal or commercial purposes. By usage of this service you agreed that to our policies. Violating these policies in any manner subject to violation of respected laws and necessary action will be initiated against the defaulters.

5. COPYRIGHT POLICY

iAmLearningHere.blogspot.in respects the copyrights, trademarks and intellectual property of others and also we expect this from other users. In this site, if you found any information that is owned by you or any content that violates your intellectual property rights, please contact to us with all necessary documents/information that authenticate your authority on your property. we will remove it as soon as possible.

6. PRIVACY POLICY

The Personal information, email that submitted while subscribing to the site, will NOT be distributed, shared with any other third-parties. We only use this data for our information, for research, to improve our services and for contacting you purposes.
iAmLearningHere.blogspot.in is an Open Database Site, so subscribe by email in site is NOT mandatory and also we won’t verify your email address. Subscribe by email into the site is purely of user’s interest. iAmLearningHere.blogspot.in reserves the right to change this policy at any time.

Sunday 18 March 2012

Stack implementaion using Array in CPP

0 comments

Definition : Stack is linear Data Structure, it is a collection of homogeneous data elements where insertion and deletion operation take place at one end only(TOP).

Operation on stack:
  • PUSH   :   insertion into stack
  • POP      :   deletion in stack
  • PEEP    :   display the last ( TOP )  element
Write a program to perform the following operations on a stack using Array (CPP).
    a.    PUSH   
    b.    POP
    c.    ISEMPTY
    d.    ISFULL
    e.    PEEP

#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#define N 5

class Stack
{
    int sArr[N];     //stack array
    int top;
public:
    Stack()      //constructor to initialize top
    {
        top=-1;
    }

    void push(int);
    void pop();
    int isEmpty();
    int isFull();
    void peep();
    void display();
};
void Stack :: push(int element)
{
    if(isFull())
    {
        cout<<"\n Stack OverFlow";
    }
    else
    {
        top++;
        sArr[top]=element;
    }
}
void Stack :: pop()
{
    if(isEmpty())
    {
        cout<<"\n Stack UnderFlow";
    }
    else
    {
        cout<<endl<<"Deleted Element is: "<<sArr[top];
        sArr[top]=NULL;
        top--;
    }
}

int Stack :: isEmpty()
{
    if(top<0)
        return 1;
    else
        return 0;
}
int Stack :: isFull()
{
    if(top == N-1)
        return 1;
    else
        return 0;
}

void Stack :: peep()
{
    if(isEmpty())
        cout<<"\n Stack is EMPTY";
    else
        cout<<"\nTOP ELEMENT IS:  "<<sArr[top];
}
void Stack :: display()
{
    cout<<endl<<"\t\t\t";
    for(int i=top ; i >= 0 ; i--)
    {
        cout<<sArr[i]<<endl<<endl<<"\t\t\t";
    }
}


void main()
{
    Stack s;  //object creation
    int ch, data;
    clrscr();
    cout<<"\n\n STACK OPERATIONS";

    while(1)
    {

    cout<<"\n\n1. PUSH";
    cout<<"\n2. POP";
    cout<<"\n3. PEEP";
    cout<<"\n4. EXIT";
    cout<<"\nEnter Choice: ";
    cin>>ch;
    clrscr();
        cout<<"\n\n STACK OPERATIONS\n\n";

        switch(ch)
        {
        case 1:
            cout<<"\n Enter Value: ";
            cin>>data;

            s.push(data);
            s.display();
            break;
        case 2: s.pop();
            s.display();
            break;
        case 3: s.peep();
            break;
        case 4: exit(0);
            break;
        }
    }
getch();
}

Data Structure Quick Sort

0 comments
Data Structure Quick Sort and Algorithms by  
Dr. Naveen Garg,
Department of Computer Science and Engineering ,IIT Delhi.





Sub Topics covered:
  • Quick sort Algorithm
  • Linear time partitioning procedure
  • analysis quick sort procedure
  • best case
  • worst case
  • average scenario
  • randomized quick sort
For more details on NPTEL visit http://nptel.iitm.ac.in

What is Pointer?

0 comments
What is Pointer? how they actuary works? and why it used?
see below video and solve all your doubts.

Describing how pointers are handled at the low-level in memory, providing a core understanding of what is going on.



Introduction to Stack and Opreations

0 comments
Tutorials on Data-Structures:
 Stack using array and linked-list implementation. 


Sub Topics:

  • Introduction to stack
  • Push operation
  • Pop operation
  • Array representation
  • Linked-list representation


source : www.learnwithtechies.com

Introduction to Data Sructure and Algorithms

0 comments
introduction to data sructure and algorithms by
 Dr. Naveen Garg





Sub Topics covered
  • Algo. problems and solution
  • what is good algo?
  • measuring the running time
  • pseudo code
  • algo. analysis
  • Insertion sort
  • asymptotic notation
For more details on NPTEL visit http://nptel.iitm.ac.in

Saturday 17 March 2012

Starting our services- stay with us

0 comments
We are launching 'iAmLearningHere' to provide you all study guide as possible, we will update this blog frequently by study materials , video tutorials and experts guidance, also post some materials regarding applications of several concepts.
 

Recent Post

Recent Comments

© 2010 IamLearningHere Template by MBT