Pages

0
1. NetCut
Jika Anda sedang berada dalam suatu jaringan komputer, lalu ada teman Anda yang curang, mendownload diam2 dengan menghabiskan bandwidth, nah....ini solusinya....
Dengan memakai NetCut, Anda bisa mengatur jaringan yang Anda gunakan, bisa saja Anda putus semua koneksi kecuali koneksi Anda. Semoga software ini dapat Anda manfaatkan dengan bijak dan benar, selamat mencoba....
Download Disini

2. Anti NetCut
Setelah Anda tahu tentang NetCut, ini ada software untuk mencegah agar koneksi Anda tidak terganggu dengan orang yang iseng memakai NetCut.....
Download disini
0

#include

#include

using namespace std;


int counter=1;

int temp=1000000;

int u,v;

int x=0;

ofstream file;


typedef struct Node

{

int data;

Node *left;

Node *right;

};


void addNode(Node **root,int newData)

{

if((*root) == NULL)

{

Node *newD;

newD = new Node;

newD->data = newData;

newD->left = NULL;

newD->right = NULL;

(*root) = newD;

(*root)->left = NULL;

(*root)->right = NULL;

cout<<"Data Added!";

}

else if(newData < (*root)->data)

addNode(&(*root)->left,newData);

else if(newData > (*root)->data)

addNode(&(*root)->right,newData);

else if(newData == (*root)->data)

cout<<"Data exist!";

}


void preOrder(Node *root){

if(root != NULL){

file << root->data << endl;

cout<<" "<<root->data;

preOrder(root->left);

preOrder(root->right);

}

}


void showLeaf(Node *root){

if(root == NULL) cout<<"Empty!";

if(root->left!=NULL) showLeaf(root->left);

if(root->right!=NULL) showLeaf(root->right);

if(root->right == NULL && root->left == NULL){

file << root->data << endl;

}

}


void showLeafZero(Node *root){

if(root == NULL) cout<<"Empty!";

if(root->left!=NULL) showLeaf(root->left);

if(root->right!=NULL) showLeaf(root->right);

if(root->right == NULL && root->left == NULL){

file << root->data << endl;

}

}


void countNodes(Node *root)

{

if(root == NULL) cout<<"Empty!";

if(root->left!=NULL){

countNodes(root->left);

x++;

file.open("D:\\File Pelajaran\\Polinema\\Semester 2\\Struktur Data\\File.txt");

file << x << endl;

file.close();

}

if(root->right!=NULL){

countNodes(root->right);

x++;

file.open("D:\\File Pelajaran\\Polinema\\Semester 2\\Struktur Data\\File.txt");

file << x << endl;

file.close();

}

}


int main(){

int choose;

Node *tree;

tree = NULL;

do

{

int data;

cout<<endl<<"======M E N U======\n";

cout<<"1. Add Node\n";

cout<<"2. Insert root and leaf data to \"File.txt\"\n";

cout<<"3. Show leaf\n";

cout<<"4. Show leaf Zero\n";

cout<<"5. Count Node\n";

cout<<"6. Exit\n";

cout<<"Choose : ";

cin>>choose;

switch(choose)

{

case 1:

x=0;

cout<<"New Data : ";

cin>>data;

addNode(&tree,data);

break;

case 2:

if(tree!=NULL){

file.open("D:\\File Pelajaran\\Polinema\\Semester 2\\Struktur Data\\File.txt");

preOrder(tree);

file.close();

}

else cout<<"Data Empty!!";

break;

case 3:

if(tree!=NULL){

file.open("D:\\File Pelajaran\\Polinema\\Semester 2\\Struktur Data\\File.txt");

showLeaf(tree);

file.close();

const int MAKS = 80;

char buf[MAKS+1];

ifstream file("D:\\File Pelajaran\\Polinema\\Semester 2\\Struktur Data\\File.txt");

while(file){

file.getline(buf,MAKS);

cout<<buf<<" ";

}

file.close();

}

else cout<<"Data Empty!!";

break;

case 4:

if(tree!=NULL){

file.open("D:\\File Pelajaran\\Polinema\\Semester 2\\Struktur Data\\File.txt");

showLeafZero(tree);

file.close();

const int MAKS = 80;

char buf[MAKS+1];

ifstream file("D:\\File Pelajaran\\Polinema\\Semester 2\\Struktur Data\\File.txt");

while(file){

file.getline(buf,MAKS);

cout<<buf<<" ";

if(buf==0){

cout << "Detect number 0 in leaf of tree!";

}

}

file.close();

}

else cout<<"Data Empty!!";

break;

case 5:

if(tree!=NULL)countNodes(tree);

else cout<<"Data Empty!!";

const int MAKS = 80;

char buf[MAKS+1];

ifstream file("D:\\File Pelajaran\\Polinema\\Semester 2\\Struktur Data\\File.txt");

file.getline(buf,MAKS);

cout<<buf;

file.close();

break;

}

}

while(choose!=6);

}

0

#include

using namespace std;


int main(){

string nama[9];

int usia[9];

for(int y=0;y<9;y++){

nama[y]="0";

usia[y]=NULL;

}

int a=0,i,m;

for(;i!=1;){

cout << "\n1. Exit\n";

cout << "2. Enqueue\n";

cout << "3. Dequeue\n";

cout << "4. Clear\n";

cout << "5. Tampil\n";

cout << "Menu Operasi Lists: ";

cin >> i;

if(i<=5){

switch (i){

case 2 :

if(a>=1){

for(int n=a;n>=1;n--){

nama[n]=nama[n-1];

usia[n]=usia[n-1];

}

}

cout << "\nNama ke-" <<>": ";

cin >> nama[0];

cout << "Usia: ";

cin >> usia[0];

a++;

break;

case 3 :

m=a;

if(a>=1){

nama[a-1]="0";

usia[a-1]=NULL;

for(int n=0;n<=(a-2);n++){

cout << "\nNama ke-" <<>": " <<>

cout << "\nUsia: " <<>

m--;

};a--;

}

break;

case 4 :

if(a>=1){

for(int n=0;n<=(a-1);n++){

nama[n]="0";

usia[n]=NULL;

};a=0;

}

break;

case 5 :

m=a;

for(int n=0;n<=(a-1);n++){

cout << "\nNama ke-" <<>": " <<>

cout << "\nUsia: " <<>

m--;

};

break;

}

}else{

cout << "Pilih Opsi dengan benar!!\n";

}

}

}