Edit syntax - asterisk for pointers, not types
This commit is contained in:
parent
c162473683
commit
34cc427533
3 changed files with 6 additions and 6 deletions
|
@ -36,13 +36,13 @@ typedef std::pair<line*, line*> two_lines;
|
||||||
|
|
||||||
// Treap data structure
|
// Treap data structure
|
||||||
class Treap {
|
class Treap {
|
||||||
line* root;
|
line *root;
|
||||||
|
|
||||||
count_type get_size(line* l);
|
|
||||||
two_lines split(line *l, count_type k);
|
two_lines split(line *l, count_type k);
|
||||||
|
|
||||||
line* join(line *a, line *b);
|
line* join(line *a, line *b);
|
||||||
line* join(two_lines two) { return join(two.first, two.second); }
|
line* join(two_lines two) { return join(two.first, two.second); }
|
||||||
|
|
||||||
|
count_type get_size(line *l);
|
||||||
line* find(line *l, count_type k);
|
line* find(line *l, count_type k);
|
||||||
line* find(count_type k);
|
line* find(count_type k);
|
||||||
count_type bulk_find(vector<string> *vec, line *l, count_type k, count_type count);
|
count_type bulk_find(vector<string> *vec, line *l, count_type k, count_type count);
|
||||||
|
|
2
main.cpp
2
main.cpp
|
@ -32,7 +32,7 @@ count_type get_tab_offset(count_type c, string text) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, const char *argv[]) {
|
||||||
// Check argument
|
// Check argument
|
||||||
if(argc <= 1) {
|
if(argc <= 1) {
|
||||||
std::cerr << "No input filename\n";
|
std::cerr << "No input filename\n";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "everything.hpp"
|
#include "everything.hpp"
|
||||||
|
|
||||||
// Get size uf a subtreap
|
// Get size uf a subtreap
|
||||||
count_type Treap::get_size(line* l) {
|
count_type Treap::get_size(line *l) {
|
||||||
if(l == nullptr) return 0;
|
if(l == nullptr) return 0;
|
||||||
return l->size;
|
return l->size;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ line* Treap::join(line *a, line *b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find k-th line of file
|
// Find k-th line of file
|
||||||
line* Treap::find(line* l, count_type k) {
|
line* Treap::find(line *l, count_type k) {
|
||||||
if(l == nullptr) return nullptr;
|
if(l == nullptr) return nullptr;
|
||||||
|
|
||||||
if(k <= get_size(l->left))
|
if(k <= get_size(l->left))
|
||||||
|
|
Loading…
Reference in a new issue