Rope Data structure implementation in C Plus Plus