Giter Club home page Giter Club logo

harismuneer / 2-3-tree Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 18.0 27 KB

๐ŸŒฒ A C++ implementation of all functionalities (insertion, deletion, search etc) of a 2-3 (two-three) Tree using Rotation, Split and Merge operations. (Please share if you find any bug in the code)

Home Page: https://github.com/harismuneer

License: MIT License

C++ 100.00%
two-three-tree two-three-trees 2-3-tree tree-data-structure balanced-search-trees b-tree data-structures open-source-code free-to-use tree-datastructures

2-3-tree's Issues

compilation error

23tree.cpp:456:27: error: no matching constructor for initialization of 'usefulData'
usefulData s1 = insert(root, d, p);
^ ~~~~~~~~~~~~~~~~~~
23tree.cpp:1168:19: note: in instantiation of member function 'two3Tree::insert' requested here
tree1.insert(data);
^
23tree.cpp:31:5: note: candidate constructor not viable: no known conversion from 'usefulData' to 'two3node ' for 1st
argument
usefulData (two3node
c)
^
23tree.cpp:57:5: note: candidate constructor not viable: expects an l-value for 1st argument
usefulData(usefulData & otherusefulData)
^
23tree.cpp:25:5: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
usefulData()
^
23tree.cpp:37:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
usefulData (two3node* c, T m)
^
23tree.cpp:497:13: error: no viable constructor returning object of type 'usefulData'
return (NULL);
^ ~~~~~~
23tree.cpp:456:32: note: in instantiation of member function 'two3Tree::insert' requested here
usefulData s1 = insert(root, d, p);
^
23tree.cpp:1168:19: note: in instantiation of member function 'two3Tree::insert' requested here
tree1.insert(data);
^
23tree.cpp:31:5: note: candidate constructor not viable: no known conversion from 'usefulData' to 'two3node ' for 1st
argument
usefulData (two3node
c)
^
23tree.cpp:57:5: note: candidate constructor not viable: expects an l-value for 1st argument
usefulData(usefulData & otherusefulData)
^
23tree.cpp:25:5: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
usefulData()
^
23tree.cpp:37:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
usefulData (two3node* c, T m)
^
23tree.cpp:811:32: error: no viable overloaded '='
s1 = Delete (r -> left, d, r);
~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~
23tree.cpp:786:9: note: in instantiation of member function 'two3Tree::Delete' requested here
Delete(root,d,p);
^
23tree.cpp:1179:19: note: in instantiation of member function 'two3Tree::deleteNode' requested here
tree1.deleteNode(data);
^
23tree.cpp:45:19: note: candidate function not viable: expects an l-value for 1st argument
usefulData operator = (usefulData & otherusefulData)
^
23tree.cpp:854:21: error: no viable constructor returning object of type 'usefulData'
return (NULL);
^ ~~~~~~
23tree.cpp:31:5: note: candidate constructor not viable: no known conversion from 'usefulData' to 'two3node ' for 1st
argument
usefulData (two3node
c)
^
23tree.cpp:57:5: note: candidate constructor not viable: expects an l-value for 1st argument
usefulData(usefulData & otherusefulData)
^
23tree.cpp:25:5: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
usefulData()
^
23tree.cpp:37:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
usefulData (two3node* c, T m)
^
23tree.cpp:863:28: error: no viable overloaded '='
s1 = rotateRight(p,r,s1.midValue,s1.child); //MidValue is just a dummy here. Used to compl...
~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23tree.cpp:45:19: note: candidate function not viable: expects an l-value for 1st argument
usefulData operator = (usefulData & otherusefulData)
^
23tree.cpp:996:28: error: no viable overloaded '='
s1 = rotateRight(p,r,s1.midValue,NULL); //MidValue is just a dummy here. Used to compl...
~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23tree.cpp:45:19: note: candidate function not viable: expects an l-value for 1st argument
usefulData operator = (usefulData & otherusefulData)
^
23tree.cpp:1012:13: error: no viable constructor returning object of type 'usefulData'
return (NULL);
^ ~~~~~~
23tree.cpp:31:5: note: candidate constructor not viable: no known conversion from 'usefulData' to 'two3node ' for 1st
argument
usefulData (two3node
c)
^
23tree.cpp:57:5: note: candidate constructor not viable: expects an l-value for 1st argument
usefulData(usefulData & otherusefulData)
^
23tree.cpp:25:5: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
usefulData()
^
23tree.cpp:37:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
usefulData (two3node* c, T m)
^
23tree.cpp:324:9: error: no viable constructor returning object of type 'usefulData'
return (NULL);
^ ~~~~~~
23tree.cpp:863:31: note: in instantiation of member function 'two3Tree::rotateRight' requested here
s1 = rotateRight(p,r,s1.midValue,s1.child); //MidValue is just a dummy here. Used to compl...
^
23tree.cpp:786:9: note: in instantiation of member function 'two3Tree::Delete' requested here
Delete(root,d,p);
^
23tree.cpp:1179:19: note: in instantiation of member function 'two3Tree::deleteNode' requested here
tree1.deleteNode(data);
^
23tree.cpp:31:5: note: candidate constructor not viable: no known conversion from 'usefulData' to 'two3node ' for 1st
argument
usefulData (two3node
c)
^
23tree.cpp:57:5: note: candidate constructor not viable: expects an l-value for 1st argument
usefulData(usefulData & otherusefulData)
^
23tree.cpp:25:5: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
usefulData()
^
23tree.cpp:37:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
usefulData (two3node* c, T m)
^
8 errors generated.

Complier Error

main.cpp:411:29: error: no matching constructor for
initialization of 'usefulData'
usefulData s1 = insert(root, d, p);
^ ~~~~~~~~~~~~~~~~~~
main.cpp:1110:19: note: in instantiation of member function
'two3Tree::insert' requested here
tree1.insert(data);
^
main.cpp:25:5: note: candidate constructor not viable: no
known conversion from 'usefulData' to
'two3node ' for 1st argument
usefulData (two3node
c)
^
main.cpp:47:5: note: candidate constructor not viable:
expects an l-value for 1st argument
usefulData(usefulData & otherusefulData)
^
main.cpp:30:5: note: candidate constructor not viable:
requires 2 arguments, but 1 was provided
usefulData (two3node* c, T m)
^
main.cpp:452:15: error: no viable constructor returning
object of type 'usefulData'
return (NULL);
^ ~~~~~~
main.cpp:411:34: note: in instantiation of member function
'two3Tree::insert' requested here
usefulData s1 = insert(root, d, p);
^
main.cpp:1110:19: note: in instantiation of member function
'two3Tree::insert' requested here
tree1.insert(data);
^
main.cpp:25:5: note: candidate constructor not viable: no
known conversion from 'usefulData' to
'two3node ' for 1st argument
usefulData (two3node
c)
^
main.cpp:47:5: note: candidate constructor not viable:
expects an l-value for 1st argument
usefulData(usefulData & otherusefulData)
^
main.cpp:30:5: note: candidate constructor not viable:
requires 2 arguments, but 1 was provided
usefulData (two3node* c, T m)
^
main.cpp:766:34: error: no viable overloaded '='
...s1 = Delete (r -> left, d, r);
~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:741:11: note: in instantiation of member function
'two3Tree::Delete' requested here
Delete(root,d,p);
^
main.cpp:1121:19: note: in instantiation of member function
'two3Tree::deleteNode' requested here
tree1.deleteNode(data);
^
main.cpp:36:19: note: candidate function not viable:
expects an l-value for 1st argument
usefulData operator = (usefulData & other...
^
main.cpp:809:23: error: no viable constructor returning
object of type 'usefulData'
return (NULL);
^ ~~~~~~
main.cpp:25:5: note: candidate constructor not viable: no
known conversion from 'usefulData' to
'two3node ' for 1st argument
usefulData (two3node
c)
^
main.cpp:47:5: note: candidate constructor not viable:
expects an l-value for 1st argument
usefulData(usefulData & otherusefulData)
^
main.cpp:30:5: note: candidate constructor not viable:
requires 2 arguments, but 1 was provided
usefulData (two3node* c, T m)
^
main.cpp:818:30: error: no viable overloaded '='
...s1 = rotateRight(p,r,s1.midValue,s1.child)...
~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:36:19: note: candidate function not viable:
expects an l-value for 1st argument
usefulData operator = (usefulData & other...
^
main.cpp:945:37: error: no matching constructor for
initialization of 'usefulData'
usefulData s1;
^
main.cpp:25:5: note: candidate constructor not viable:
requires single argument 'c', but no arguments were
provided
usefulData (two3node* c)
^
main.cpp:47:5: note: candidate constructor not viable:
requires single argument 'otherusefulData', but no
arguments were provided
usefulData(usefulData & otherusefulData)
^
main.cpp:30:5: note: candidate constructor not viable:
requires 2 arguments, but 0 were provided
usefulData (two3node* c, T m)
^
main.cpp:967:15: error: no viable constructor returning
object of type 'usefulData'
return (NULL);
^ ~~~~~~
main.cpp:25:5: note: candidate constructor not viable: no
known conversion from 'usefulData' to
'two3node ' for 1st argument
usefulData (two3node
c)
^
main.cpp:47:5: note: candidate constructor not viable:
expects an l-value for 1st argument
usefulData(usefulData & otherusefulData)
^
main.cpp:30:5: note: candidate constructor not viable:
requires 2 arguments, but 1 was provided
usefulData (two3node* c, T m)
^
main.cpp:279:11: error: no viable constructor returning
object of type 'usefulData'
return (NULL);
^ ~~~~~~
main.cpp:818:33: note: in instantiation of member function
'two3Tree::rotateRight' requested here
s1 = rotateRight(p,r,s1....
^
main.cpp:741:11: note: in instantiation of member function
'two3Tree::Delete' requested here
Delete(root,d,p);
^
main.cpp:1121:19: note: in instantiation of member function
'two3Tree::deleteNode' requested here
tree1.deleteNode(data);
^
main.cpp:25:5: note: candidate constructor not viable: no
known conversion from 'usefulData' to
'two3node ' for 1st argument
usefulData (two3node
c)
^
main.cpp:47:5: note: candidate constructor not viable:
expects an l-value for 1st argument
usefulData(usefulData & otherusefulData)
^
main.cpp:30:5: note: candidate constructor not viable:
requires 2 arguments, but 1 was provided
usefulData (two3node* c, T m)
^
8 errors generated.
compiler exit status 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.