Categories
Mastering Development

family tree in SWI PROLOG

there is some error with the grandma , cousin, brother, uncle rules i tried so many rules but still could not find the correct one it returns false , please helpppppppppp /*rules*/ male(james). male(charles). male(william). female(megan). male(george). female(catherine). female(diana). female(elizabith). parent(james, charles). parent(james, elizabeth). parent(charles, catherine). parent(charles, william). parent(charles, megan). parent(elizabeth, diana). parent(diana, george). /*rules*/ […]

Categories
Development

AVL tree implementation using non recursive insert method

I’m learning to implement AVL tree and I’m stuck… Trying to implement Insert function non-recursively. it’s been 3 days already and I’m lost. Here is my code… Hope someone can help me 🙂 #include <iostream> using namespace std; class Node{ // WORKS public: Node *left, *right, *parent; int elem, height; Node(Node* l, Node* r, Node* […]