<commit_before>#include <iostream> 
#include <string> 
#include <fstream> 
using namespace std; 
 
template<typename T> 
struct Node 
{ 
	T x; 
	Node<T>* left; 
	Node<T>* right; 
}; 
 
template<typename T> 
class Tree 
{ 
	private: 
	Node<T> * root; 
	public: 
	Tree() 
	{
		root = new Node<T>;
		root->x = 0;
		root->left = root->right = NULL;
	}
	
	~Tree() 
	{
		deleteNode(root);
	}
	
	void deleteNode(Node<T> node)
	{
		if (node == NULL) return;
		deleteNode(node->left);
		deleteNode(node->right);
		delete node;
	} 
	
	T x_() const
	{
		return root->x;
	} 
 
	Node<T>* left_() const
	{
		return root->left;
	} 
 
	Node<T>* right_() const
	{
		return root->right;
	} 
 
	void add(T newEl)
	{
		if (root == NULL)
			root->x = newEl;
		else
		{
			Node<T>* El = NULL;
			Node<T>* curEl = root;
			while (curEl != NULL)
			{
				El = curEl;
				if (newEl > curEl->x)
					curEl = curEl->right;
				else 
					if (newEl < curEl->x)
						curEl = curEl->left;
				else return;
			}
			if (newEl > El->x)
			{
				El->right = new Node<T>;
				El->right->x = newEl;
				El->right->left = El->right->right = NULL; 
			}
			else 
			{	
				El->left = new Node<T>;
				El->left->x = newEl;
				El->left->left = El->left->right = NULL; 
			}
		}
	} 

	Tree<T> search(T x) 
	{ 
		Node<T>* curEl = root;
		while (curEl != NULL) 
		{ 
			if (curEl->x == x) 
				return curEl; 
			else
			{ 
				if (x > curEl->x) 
					curEl = curEl->right;
				else curEl = curEl->left; 
			} 
		} 
		return nullptr; 
	} 
 
	void fIn(string filename) 
	{ 
		ifstream fin; 
		fin.open(filename); 
		if (!fin.is_open()) 
			cout << "The file isn't find" << endl; 
		else 
		{ 
			deleteNode(root); 
			root = new Node<T>; 
			root->x = 0; 
			root->left = root->right = NULL; 
			if (fin.eof()) return; 
			else 
			{  
				fin >> root->x; 
				while (!fin.eof()) 
				{ 
					T newEl; 
					fin >> T; 
					add(T); 
				} 
			} 
			fin.close(); 
		} 
	} 
 
	void fOut(string filename)const 
	{ 
		ofstream fout; 
		fout.open(filename); 
		if (!fin.is_open()) 
			cout << "The file isn't find" << endl; 
		else 
		{ 
			Out(fout); 
			fout.close(); 
		} 
	} 
 
	void Out(ostream & stream)const 
	{ 
		curEl = root;
		if (curEl != NULL) 
		{ 
			stream << curEl->x << endl; 
			Out(curEl->left); 
			Out(curEl->right); 
		} 
	} 
};<commit_msg>Update BinaryTree.hpp<commit_after>#include <iostream> 
#include <string> 
#include <fstream> 
using namespace std; 
 
template<typename T> 
struct Node 
{ 
	T x; 
	Node<T>* left; 
	Node<T>* right; 
}; 
 
template<typename T> 
class Tree 
{ 
	private: 
	Node<T> * root; 
	public: 
	Tree() 
	{
		root = new Node<T>;
		root->x = 0;
		root->left = root->right = NULL;
	}
	
	~Tree() 
	{
		deleteNode(root);
	}
	
	void deleteNode(Node<T> node)
	{
		if (node == NULL) return;
		deleteNode(node->left);
		deleteNode(node->right);
		delete node;
	} 
	
	T x_() const
	{
		return root->x;
	} 
 
	Node<T>* left_() const
	{
		return root->left;
	} 
 
	Node<T>* right_() const
	{
		return root->right;
	} 
 
	void add(T newEl)
	{
		if (root == NULL)
			root->x = newEl;
		else
		{
			Node<T>* El = NULL;
			Node<T>* curEl = root;
			while (curEl != NULL)
			{
				El = curEl;
				if (newEl > curEl->x)
					curEl = curEl->right;
				else 
					if (newEl < curEl->x)
						curEl = curEl->left;
				else return;
			}
			if (newEl > El->x)
			{
				El->right = new Node<T>;
				El->right->x = newEl;
				El->right->left = El->right->right = NULL; 
			}
			else 
			{	
				El->left = new Node<T>;
				El->left->x = newEl;
				El->left->left = El->left->right = NULL; 
			}
		}
	} 

	Tree<T> search(T x) 
	{ 
		Node<T>* curEl = root;
		while (curEl != NULL) 
		{ 
			if (curEl->x == x) 
				return curEl; 
			else
			{ 
				if (x > curEl->x) 
					curEl = curEl->right;
				else curEl = curEl->left; 
			} 
		} 
		return nullptr; 
	} 
 
	void fIn(string filename) 
	{ 
		ifstream fin; 
		fin.open(filename); 
		if (!fin.is_open()) 
			cout << "The file isn't find" << endl; 
		else 
		{ 
			deleteNode(root); 
			root = new Node<T>; 
			root->x = 0; 
			root->left = root->right = NULL; 
			if (fin.eof()) return; 
			else 
			{  
				fin >> root->x; 
				while (!fin.eof()) 
				{ 
					T newEl; 
					fin >> T; 
					add(T); 
				} 
			} 
			fin.close(); 
		} 
	} 
 
	void fOut(string filename)const 
	{ 
		ofstream fout; 
		fout.open(filename); 
		if (!fin.is_open()) 
			cout << "The file isn't find" << endl; 
		else 
		{ 
			Out(fout); 
			fout.close(); 
		} 
	} 

void Out(ostream & stream)const 
	{ 
	Node <T>* curEl = root;
		if (curEl != NULL) 
		{ 
			stream << curEl->x << endl; 
			Out(curEl->left); 
			Out(curEl->right); 
		} 
	} 
};
{'fraction_non_alphanumeric': 0.17179763186221744, 'fraction_numerical': 0.000861141011840689, 'mean_word_length': 1.9974193548387096, 'pattern_counts': {'":': 0, '<': 68, '<?xml version=': 0, '>': 134, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5073342', 'n_tokens_mistral': 2464, 'n_tokens_neox': 1976, 'n_words': 423}