Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:
// Node.cpp: implementation of the Node class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ConvexHull.h"
#include "Node.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Node::Node(){
_next=this;
_prev=this;
}
Node::~Node(){
}
Node* Node::insert(Node* b){
Node* c = _next;
b->_next = c;
b->_prev = this;
_next = b;
c->_prev = b;
return b;
}
void Node::splice(Node* b){
Node *a = this;
Node *an = a->_next;
Node *bn = b->_next;
a->_next = bn;
b->_next = an;
an->_prev = b;
bn->_prev = a;
}
Node* Node::remove(void){
_prev->_next = _next;
_next->_prev = _prev;
_next = _prev = this;
return this;
}
Соседние файлы в папке ConvexHull