All pastes #1405028 Raw Edit

Fehlende Klammern

public cpp v1 · immutable
#1405028 ·published 2009-04-27 17:06 UTC
rendered paste body
string Airport::extractMin(){	string res = events[0].element;	events[0].key = NOTHING;	last--;	swap(0, last);	int downward = 0;	while (downward < last) {		int child1 = downward*2+1;		int child2 = downward*2+2;		int child = child1;		if (child1 >= last) /* SECOND amendment */			break;		else if (child2 >= last)			child = child1;		else /* Finding minimum between two children */		if (events[child2].key < events[child].key)			child = child2;		if (child >= last)			break;		else if (events[downward].key > events[child].key) {			swap(downward, child);			downward = child;		} else			break;	}	return res;}