Refactor comments and typedef

This commit is contained in:
Matúš Púll 2025-03-28 18:17:13 +01:00
parent ec1d64e9ba
commit 734588316d

View file

@ -4,8 +4,6 @@
using std::string;
typedef unsigned long long count_type;
class line;
typedef std::pair<line*, line*> two_lines;
// Treap node representation of a line
struct line {
@ -15,6 +13,7 @@ struct line {
line(count_type _p, string _t) : priority(_p), text(_t), size(1), left(nullptr), right(nullptr) {}
};
typedef std::pair<line*, line*> two_lines;
// Treap representation of a file
class file {
@ -83,10 +82,10 @@ public:
root = nullptr;
}
// File access
// Don't find index k, but k-th line -> +1
line* find(count_type k) {
if(k >= root->size)
return nullptr;
// Don't find index k, but k-th line -> +1
return find(root, k+1);
}