Skip to content

Commit f1ba50d

Browse files
committed
check
1 parent 512db43 commit f1ba50d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pydatastructs/trees/_backend/cpp/BinaryTree.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static PyObject* BinaryTree___new__(PyTypeObject* type, PyObject *args, PyObject
3333
PyObject *key = PyObject_GetItem(args, PyZero);
3434
PyObject *root_data = PyObject_GetItem(args, PyOne);
3535
PyObject *comp = PyObject_GetItem(args, PyTwo);
36-
PyObject *is_order_statistic = PyObject_GetItem(args, PyThree);
36+
PyObject *is_ordered_statistic = PyObject_GetItem(args, PyThree);
3737
if( (key == Py_None) && (root_data != Py_None) ) {
3838
PyErr_SetString(PyExc_ValueError, "Key required.");
3939
return NULL;
@@ -42,7 +42,7 @@ static PyObject* BinaryTree___new__(PyTypeObject* type, PyObject *args, PyObject
4242
Py_INCREF(Py_None);
4343
key = root_data == Py_None ? Py_None : key; // This key is the argument, not self->key
4444

45-
PyObject* root = TreeNode___new__(key, root_data); // check if this is correct
45+
PyObject* root = TreeNode___new__(&TreeNodeType, key, root_data); // check if this is correct
4646
root->is_root = true;
4747

4848
self->root_idx = 0;
@@ -53,12 +53,12 @@ static PyObject* BinaryTree___new__(PyTypeObject* type, PyObject *args, PyObject
5353
self->size = 1;
5454

5555
if(comp == Py_None){
56-
self->comparator = PyObject_RichCompare(PyObject *key1, PyObject *key2, Py_LT);
56+
self->comparator = PyObject_RichCompare(PyObject *key1, PyObject *key2, Py_LT); // lambda functions, check how to do this
5757
}
5858
else{
5959
self->comparator = comp;
6060
}
61-
self->is_order_statistic = is_order_statistic;
61+
self->is_ordered_statistic = is_ordered_statistic;
6262

6363
return reinterpret_cast<PyObject*>(self);
6464
}
@@ -82,7 +82,7 @@ static PyObject* BinaryTree___str__(BinaryTree *self) {
8282
long size = self->tree->_last_pos_filled+1;
8383
PyObject* list = PyList_New(size);
8484
for(int i=0;i<size;i++){
85-
PyObject* node = self->tree->_one_dimensional_array->_data[i]; // check this
85+
TreeNode* node = self->tree->_one_dimensional_array->_data[i]; // check this
8686
if(node != Py_None){
8787
PyObject* out = Py_BuildValue("(OllO)", node->left, node->key, node->data, node->right);
8888
Py_INCREF(out);

0 commit comments

Comments
 (0)