Skip to content

Instantly share code, notes, and snippets.

@mirsahib
Last active March 18, 2018 14:38
Show Gist options
  • Save mirsahib/3fb91d10dd610d24d773ffb0f3d99e1e to your computer and use it in GitHub Desktop.
Save mirsahib/3fb91d10dd610d24d773ffb0f3d99e1e to your computer and use it in GitHub Desktop.
#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