Sunday, 23 December 2012

Download Message Protection System for Android by Hitesh Toliya



Messege Protaction android

Developer Name :
hitesh toliya
Project Name :
Messege Protaction android
Project Type :
desktop Application
Project Language :
android
Project Description :
message protraction in android phone. first time set password is by default password. hide massage and protraction with password.
Upload Date :
2011-11-14
Source Code Link :
Download Here (0.4127MB)
read more...

Deleting in Binary Tree

/* Deleting in Binary Tree */
/* DELET_BT.C */

# include<stdio.h>
# include<malloc.h>

struct NODE
{
    int Info;
    struct NODE *Left_Child;
    struct NODE *Right_Child;
};

int depth;
void Output (struct NODE *, int );
struct NODE *Delet_Node (struct NODE *, int );
struct NODE *Create_Tree (int , struct NODE *);
struct NODE * DELE(struct NODE *, struct NODE *);

/* Output function */

void Output(struct NODE *T, int Level)
{
    int i;
    if (T)
    {
        Output(T->Right_Child, Level+1);
        printf("\n");
        for (i = 0; i < Level; i++)
            printf("  ");
        printf("%c", T->Info);
        Output(T->Left_Child, Level+1);
    }
}

/* Delete a node in the binary tree */

struct NODE * DELE(struct NODE *Node1, struct NODE *Node)
{
    struct NODE *DNode;
    if (Node1->Right_Child != NULL)
        Node1->Right_Child = DELE(Node1->Right_Child, Node);
    else
    {
        DNode = Node1;
        Node->Info = Node1->Info;
        Node1 = Node1->Left_Child;
        free(DNode);
    }
    return (Node1);
}

/* Deletion in binary tree */

struct NODE * Delet_Node (struct NODE *Node, int Info)
{
    struct NODE *Temp;

    if (Node == NULL)
    {
        printf("\n Information does not exist in the above tree");
        return (Node);
    }
    else
    {
        if (Info < Node->Info )
            Node->Left_Child = Delet_Node (Node->Left_Child, Info);
        else
            if (Info > Node->Info )

                Node->Left_Child = Delet_Node (Node->Right_Child, Info);
            else
            {
                Temp = Node;
                if (Temp->Right_Child == NULL)
                {
                    Node = Temp->Left_Child;
                    free(Temp);
                }
                else
                    if (Temp->Left_Child == NULL)
                    {
                        Node = Temp->Right_Child;
                        free(Temp);
                    }
                    else
                        Temp->Left_Child = DELE(Temp->Left_Child, Temp);
            }
    }
    return(Node);
}

/* Create binary tree */

struct NODE *  Create_Tree (int Info, struct NODE *Node)
{
    if (Node == NULL)
    {
        Node = (struct NODE *) malloc(sizeof(struct NODE));
        Node->Info = Info;
        Node->Left_Child = NULL;
        Node->Right_Child = NULL;
        return (Node);
    }

    /* Test for the left child */

    if (Info < Node->Info)

        Node->Left_Child = Create_Tree (Info, Node->Left_Child);

    else

        /* Test for the right child */

        if (Info >= Node->Info)

            Node->Right_Child = Create_Tree (Info, Node->Right_Child);
    return(Node);
}

/* Function main */

void main()
{
    int Number = 0;
    int Info ;
    char choice;
    int depth;
    struct NODE *T = (struct NODE *) malloc(sizeof(struct NODE));
    T = NULL;
    printf("\n Input choice 'b' to break:");
    choice = getchar();

    while(choice != 'b')
    {
        fflush(stdin);
        printf("\n Input information of the node: ");
        scanf("%c", &Info);
        T = Create_Tree(Info, T);
        Number++;
        fflush(stdin);
        printf("\n Input choice 'b' to break:");
        choice = getchar();
    }
    fflush(stdin);
    printf("\n Number of elements in the list is %d", Number);
    printf("\n Tree is \n");
    Output(T, 1);

    printf("\n Input the information to which want remove from the above tree: ");
    scanf("%c", &Info);

    T = Delet_Node(T, Info);
    printf("\n Tree after deletion of a node: ");
    Output(T, 1);
}
read more...

Create Binary TREE

/* Create Binary TREE */
/* CREAT_BT.C */

# include<stdio.h>
# include<malloc.h>

struct NODE
{
    int Info;
    struct NODE *Left_Child;
    struct NODE *Right_Child;
};

struct NODE *Binary_Tree (char *, int, int);
void Output(struct NODE *, int );

/* Function to insert an element into tree */

struct  NODE *  Binary_Tree (char *List, int Lower, int Upper)
{
    struct NODE *Node;
    int Mid = (Lower + Upper)/2;
    Node = (struct NODE *) malloc(sizeof(struct NODE));

    Node->Info = List [Mid];
    if ( Lower>= Upper)
    {
        Node->Left_Child = NULL;
        Node->Right_Child = NULL;
        return (Node);
    }

    if (Lower <= Mid - 1)
        Node->Left_Child = Binary_Tree (List, Lower, Mid - 1);
    else
        Node->Left_Child = NULL;
    if (Mid + 1 <= Upper)
        Node->Right_Child = Binary_Tree (List, Mid + 1, Upper);
    else
        Node->Right_Child = NULL;
    return(Node);
}

/* Output function */

void Output(struct NODE *T, int Level)
{
    int i;
    if (T)
    {
        Output(T->Right_Child, Level+1);
        printf("\n");
        for (i = 0; i < Level; i++)
            printf("   ");
        printf("%c", T->Info);
        Output(T->Left_Child, Level+1);
    }
}

/* Function main */

void main()
{
    char List[100];
    int Number = 0;
    char Info ;
    char choice;
    struct NODE *T = (struct NODE *) malloc(sizeof(struct NODE));
    T = NULL;
    printf("\n Input choice 'b' to break:");
    choice = getchar();
    while(choice != 'b')
    {
        printf("\n Input information of the node: ");
        scanf("%c", &Info);
        List[Number++] = Info;
        fflush(stdin);
        printf("\n Input choice 'b' to break:");
        choice = getchar();
    }
    Number --;
    printf("\n Number of elements in the lsit is %d", Number);
    T = Binary_Tree(List, 0, Number);
    Output(T,1);
}
read more...

C Example: Binary tree traversal

/*
 Data Structure Example in C for
 Binary tree traversal */
/* BT_TRAV.C */

# include<stdio.h>

struct NODE
{
    char Info;
    struct NODE *Left_Child;
    struct NODE *Right_Child;
};

struct NODE *Binary_Tree (char *, int, int);
void Output(struct NODE *, int );
void Pre_order(struct NODE *);
void In_order(struct NODE *);
void Post_order(struct NODE *);

/* Function to create an binary tree */

struct NODE *  Binary_Tree (char *List, int Lower, int Upper)
{
    struct NODE *Node;
    int Mid = (Lower + Upper)/2;
    Node = (struct NODE*) malloc(sizeof(struct NODE));

    Node->Info = List [Mid];
    if ( Lower>= Upper)
    {
        Node->Left_Child = NULL;
        Node->Right_Child = NULL;
        return (Node);
    }

    if (Lower <= Mid - 1)
        Node->Left_Child = Binary_Tree (List, Lower, Mid - 1);
    else
        Node->Left_Child = NULL;
    if (Mid + 1 <= Upper)
        Node->Right_Child = Binary_Tree (List, Mid + 1, Upper);
    else
        Node->Right_Child = NULL;
    return(Node);
}

/* Output function */

void Output(struct NODE *T, int Level)
{
    int i;
    if (T)
    {
        Output(T->Right_Child, Level+1);
        printf("\n");
        for (i = 0; i < Level; i++)
            printf("   ");
        printf(" %c", T->Info);
        Output(T->Left_Child, Level+1);
    }
}

/* Pre-order traversal */

void Pre_order (struct NODE *Node)
{
    if (Node)
    {
        printf(" %c", Node->Info);
        Pre_order(Node->Left_Child);
        Pre_order(Node->Right_Child);
    }
}

/* In-order traversal */

void In_order (struct NODE *Node)
{
    if (Node)
    {
        In_order(Node->Left_Child);
        printf(" %c", Node->Info);
        In_order(Node->Right_Child);
    }
}

/* Post-order traversal */

void Post_order (struct NODE *Node)
{
    if (Node)
    {
        Post_order(Node->Left_Child);
        Post_order(Node->Right_Child);
        printf(" %c", Node->Info);
    }
}

/*  Function main */

void main()
{
    char List[100];
    int Number = 0;
    char Info;
    char choice;
    struct NODE *T = (struct NODE *) malloc(sizeof(struct NODE));
    T = NULL;
    printf("\n Input choice 'b' to break:");
    choice = getchar();
    fflush(stdin);
    while(choice != 'b')
    {
        printf("\n Input information of the node: ");
        scanf("%c", &Info);
        List[Number++] = Info;
        fflush(stdin);
        printf("\n Input choice 'b' to break:");
        choice = getchar();
        fflush(stdin);
    }
    Number --;
    printf("\n Number of elements in the list is %d", Number);
    T = Binary_Tree(List, 0, Number);
    Output(T,1);
    printf("\n Pre-order traversal\n");
    Pre_order (T);
    printf("\n In-order traversal\n");
    In_order (T);
    printf("\n Post-order traversal\n");
    Post_order (T);
}
read more...

Popular Posts