2018-02-28 09:05:45 +01:00
|
|
|
#include "mavl.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Init an AVL Tree Iterator.
|
|
|
|
*
|
|
|
|
* After initialization #mavliter_next would return the first element.
|
|
|
|
* The behavior of #mavliter_get would still be undefined.
|
|
|
|
* @param i AVL Iterator to initialize
|
|
|
|
* @param t correspondending AVL Tree
|
|
|
|
*
|
2018-03-11 00:56:41 +01:00
|
|
|
* @See mavliter_t,
|
2018-02-28 09:05:45 +01:00
|
|
|
*/
|
2018-03-11 00:56:41 +01:00
|
|
|
void mavliter_init ( mavliter_t *i, mavl_t t )
|
|
|
|
{
|
2018-02-28 09:05:45 +01:00
|
|
|
i->root = t->root;
|
2018-03-11 00:56:41 +01:00
|
|
|
i->stack_ptr = 0;
|
|
|
|
i->cmp = t->cmp;
|
2018-02-28 09:05:45 +01:00
|
|
|
}
|