, , , , , . .

 

 

!

 

:

:

 

 

 

?

StudentHelp, , MS Word. , , antiplagiat.ru, etxt.ru advego.ru. StudentHelp , Word .


:


:

: . : 04.06.2012. : 2011. : 15. antiplagiat.ru: < 30%

():










""



    :
    : -819
    : .. : ..

2010





    充....3
    腅......4
    充....8
    .9
    ....12



6.
( ) ().
2. , , .


. , , . , . :




.1.




:
    Tree . (elem *head) (LowerList *end) .

    Elem - . (elem* left) (elem* right) . (int len), . . .

    Felem - . (long fl) (long fr) . (int sz).





























. . , , . , , . , , , .
9, 44, 0, 7, 10, 6, 12.
9 , , , . .




.2.

, n . , , . , . 1.











: , 15


.3.



























Tree .

void push(char* str);
. . . , . bool test_balanse();. , void balance();.

bool balanse();
. true, false .

void balance();
. . size void savetomas(char** mas,int& index) . . .


void put_to_ready(int index,int l,int r,char** mas,char** ready_mas);
堠 ( index ), ( l ), ( r ), ( mas ) , ( ready_mas ).

void med_len();
. , int. , .

int med(int min, int max);
, . .


void len();
. elem void define_len(int _len); , , .

elem


void print();
. , .

void clear();
. .

Char* getstr();
. , , .














    .. ++ , . : - , 2003.
    ++ lessons
    ++. . ./ . , 2000. 496.
    . . - ++. 1992.


















































#include <iostream>
#include <time.h>
#include <conio.h>
#include <string>
#define FNULL -1L
#define TSZ sizeof(felem)
using namespace std;

class tree
{
public:

//
struct elem
{

char *p; //
elem *left,*right; //
int count; //
int len; //

//
elem()
{
p = NULL;// =0
left = right = NULL;/// =0
count = 0;
len = -1;
}


//
elem(char *str)
{
p = new char[strlen(str) + 1];// +1
strncpy(p, str, strlen(str) + 1);//
left = right = NULL;
count = 0;
len = -1;
}


//
~elem()
{
delete[] p;
}

//
void print()
{
cout << " count= " << count << " len= " << len << " p= " << p << endl;//
if(left)
this->left->print();// 0
if(right)
this->right->print();// 0
}

//
void len()
{
head->define_len(0);
}

//
void define_len(int _len)
{
len = _len;//
if(left)
left->define_len(len + 1);// 1
if(right)
right->define_len(len + 1);// 1
}



//
int get_top_count(int &_count)// , , .
{
if(left)
left->get_top_count(_count);//
if(right)
right->get_top_count(_count);//
if(!left && !right)//
_count++;// 1
return _count;
}


//
int get_sum_len(int &_len)// , , .
{
if(left)
left->get_sum_len(_len);//
if(right)
right->get_sum_len(_len);//
if(!left && !right && len > -1)// >-1
_len += len;// , _( )
return _len;
}


//
void med_len()
{
cout << head->med_len() << endl;
}

//
int med_len()
{
int len = 0;
int a = get_sum_len(len);//
len = 0;//
int b = get_top_count(len);//
return a / b;//
}

//
void del()
{
if(left)
this->left->del();//
if(right)
this->right->del();//
delete[] p;// ,
}

//
void clear()
{
if(left)
{
this->left->clear();// ( ),
} // ,
if(right) // , , .
{
this->right->clear();
}
if(left)
delete left;
if(right)
delete right;

}

//
int summ(int r)
{
r += count;//
if(left){
r += left->count;}//
if(right){
r += right->count;}//
return r;
}


//
void push(char *str)
{
this->count++;
if(strlen(str) < strlen(this->p))//
{
if(this->left == NULL)//
{
this->left = new elem;//
this->left->p = new char[strlen(str) + 1];//
strncpy(left->p, str, strlen(str) + 1);//
}
else
this->left->push(str);// -,
}
else//
{
if(this->right == NULL)
{
this->right = new elem;
this->right->p = new char[strlen(str) + 1];
strncpy(right->p, str, strlen(str) + 1);
}
else
this->right->push(str);
..................



90% antiplagiat.ru, etxt.ru advego.ru




* . , .