Last active
March 18, 2018 14:38
-
-
Save mirsahib/3fb91d10dd610d24d773ffb0f3d99e1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class node{ | |
private: | |
int cost; | |
int predecessor; | |
bool visited; | |
public: | |
node(){ | |
this->cost = 0; | |
this->predecessor =-1; | |
this->visited = false; | |
}; | |
int getCost(){ | |
return this->cost; | |
}; | |
int getPredecessor(){ | |
return this->predecessor; | |
}; | |
bool isVisited(){ | |
return this->visited; | |
}; | |
void setVisited(bool v){ | |
this->visited = v; | |
}; | |
void setCost(int c){ | |
this->cost = c; | |
}; | |
void setPredecessor(int p){ | |
this->predecessor = p; | |
}; | |
bool operator<(const &node a,const &node b){ | |
return a->getCost()<b->getCost(); | |
} | |
}; | |
int main() | |
{ | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment