Skip to content

mdaamir151/indexed_tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

indexed_tree

A sequence container that supports O(log n) indexing, O(log n) insertion, O(logn n) deletion, O(log n) search and O(n) iteration,

USAGE :

initialization-

ordered_tree ot;

Insertion -

ot.insert(pos,val)

ot.push_back(val) is equivalent to ot.insert(ot.size(),val)

ot.push_front(val) is equivalent to ot.insert(1,val)

Deletion-

ot.remove(pos)

Getter and setter (indexing)-

x = ot[pos]

ot[pos] = new_val

Height of tree-

h = ot.height()

size of container-

s = ot.size()

iteration -

don't use getter/setter for iteration, instead use iterator

ordered_tree:: iterator it = ot.begin();

for(;it!=ot.end();it++) cout<<*it<<" ";

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages