Calculator Using PHP… Calculator span{background-color: lightgreen;border: 2px solid black;textcolor: red;}div input{ background-color: lightgrey; width: 320px; padding: 5px; border: 1px solid navy; margin: 25px;}div button{ background-color: #FFFFF0; width: 360px; height: 40px; padding: 5px; border: 2px solid green; }div td{ background-color:#FFEBFF; width: 200px; height:Continue reading “Calculator using PHP and Css 3 ,html 5”
Category Archives: http://schemas.google.com/blogger/2008/kind#post
DFS tree in C++
#include#includeint cost[10][10],i,j,k,n;int stack[10],top,v,visit[10],visited[10];void main(){clrscr();int m;cout <<"Enter no of vertices\Nodes: ";cin >> n;cout <<"\nEnter no of Edges: ";cin >> m;cout <<"\n\tEnter All EDGES Source & Distination\n";for(k=1;k<=m;k++){cout<<"\nEnter Source: ";cin >>i;cout<<"\nEnter Distination: ";cin>>j;cost[i][j]=1;cout<<"\n———————–\n";}cout <<"\nEnter initial vertex: ";cin >>v;cout <<"\nORDER OF VISITED VERTICES:\n";cout <<v<<" ";visited[v]=1;k=1;while(k<n){for(j=n;j>=1;j–)if(cost[v][j]!=0 && visited[j]!=1 && visit[j]!=1){visit[j]=1;stack[top]=j;top++;}v=stack[–top];cout<<v << " ";k++;visit[v]=0;visited[v]=1;}getch();}
BFS tree Code in C++
#include#includeint cost[10][10],i,j,k,n;int que[10],front,rare,v,visit[10],visited[10];void main(){clrscr();int m;cout <<"Enter no of vertices\ Nodes: ";cin >> n;cout <<"\nEnter no of Edges: ";cin >> m;cout <<"\n\tEnter All EDGES by source & destination\n";for(k=1;k<=m;k++){cout<<"\nEnter Source: ";cin >>i;cout<<"\nEnter Destination: ";cin>>j;cost[i][j]=1;cout<<"\n———————–\n";}cout <<"\nEnter initial vertex: ";cin >>v;cout <<"Visitied vertices:\n";cout << v<<" ";visited[v]=1;k=1;while(k<n){for(j=1;j<=n;j++)if(cost[v][j]!=0 && visited[j]!=1 && visit[j]!=1){visit[j]=1;que[rare++]=j;}v=que[front++];cout<<v << " ";k++;visit[v]=0;visited[v]=1;}getch();}
AVL Balance Tree in C++
AVL TREE IMPLEMENTAION:#include#include#includestruct avl_node{ int data; struct avl_node *left; struct avl_node *right;}*root;int max(int a,int b){if (a>b){return a;}else { return b;}}class avlTree{ public: avlTree() { root = NULL; }int height(avl_node *temp){ int h = 0; if (temp != NULL) { int l_height = height (temp->left); int r_height =Continue reading “AVL Balance Tree in C++”
Red and Black Tree in C++
RED AND BLACK TREE: All the case’s of Insertion Deletion , Searching and Display ” Using typedef and Structure user define data types.Code in C++ ↓↓↓↓↓↓↓Code is Bellow ☺ ☻ ↓↓↓↓↓↓↓↓↓↓↓↓ Source code:Programming Seekerz : ☺#include #include #include #include enum rbtree_node_color { RED, BLACK }; typedef struct rbtree_node_t { void* key; void* value; Continue reading “Red and Black Tree in C++”
Make all values of tree negative -ive
#include#includeclass Node{private: int data; Node* right; Node* left;public: Node(){ root=NULL; right=left=NULL; }Node *root; void insert(int data){ Node* newnode = new Node(); newnode->data = data; if (root == NULL){ root=newnode; return; } Node *p,*q; p=q=root; while (q!=NULL){ p=q; if (newnode->data> q->data) q = q->right; else q = q->left; } if (newnode->data> p->data) p->right = newnode; elseContinue reading “Make all values of tree negative -ive”
Making all even values odd in a tree
#include#includeclass Node{private: int data; Node* right; Node* left;public: Node(){ root=NULL; right=left=NULL; }Node *root; void insert(int data){ Node* newnode = new Node(); newnode->data = data; if (root == NULL){ root=newnode; return; } Node *p,*q; p=q=root; while (q!=NULL){ p=q; if (newnode->data> q->data) q = q->right; else q = q->left; } if (newnode->data> p->data) p->right = newnode; elseContinue reading “Making all even values odd in a tree”
Make all Odd values Even in a tree
#include#includeclass Node{private: int data; Node* right; Node* left;public: Node(){ root=NULL; right=left=NULL; }Node *root; void insert(int data){ Node* newnode = new Node(); newnode->data = data; if (root == NULL){ root=newnode; return; } Node *p,*q; p=q=root; while (q!=NULL){ p=q; if (newnode->data> q->data) q = q->right; else q = q->left; } if (newnode->data> p->data) p->right = newnode; elseContinue reading “Make all Odd values Even in a tree”
Display only Odd values from tree
#include#includeclass Node{private: int data; Node* right; Node* left;public: Node(){ root=NULL; right=left=NULL; }Node *root; void insert(int data){ Node* newnode = new Node(); newnode->data = data; if (root == NULL){ root=newnode; return; } Node *p,*q; p=q=root; while (q!=NULL){ p=q; if (newnode->data> q->data) q = q->right; else q = q->left; } if (newnode->data> p->data) p->right = newnode; elseContinue reading “Display only Odd values from tree”
Display only even Values from tree
#include#includeclass Node{private: int data; Node* right; Node* left;public: Node(){ root=NULL; right=left=NULL; }Node *root; void insert(int data){ Node* newnode = new Node(); newnode->data = data; if (root == NULL){ root=newnode; return; } Node *p,*q; p=q=root; while (q!=NULL){ p=q; if (newnode->data> q->data) q = q->right; else q = q->left; } if (newnode->data> p->data) p->right = newnode; else p->left =Continue reading “Display only even Values from tree”