java - how to convert a list into an avl tree -



need change list interface avl-tree. know how avl tree works, still don't get, how save data in structure.

is neccessary still keep id of old list items , link them avl tree?
writing small rpg, quests , events saved in 2 lists , got different ids.

this how items list:

public item getitem(int i) {   if (i < 0 || >= length()) {     throw new indexoutofboundsexception(string.format("%d / %d", i, length()));   }   if (i <= 0) {     return firstitem();   } return next.getitem(--i); } 


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -