i made a second version of a red black tree program i was working on. the first version used a standard reading of the input file sequentially adding each city to the tree. this wasn't working very well since the file provided sorted input. the resulting tree was heavily skewed to the right because of this.
in this version of the program, i read the input file into a vector and then randomly sampled from the vector for input to the tree until each item was used.
for some reason i haven't been able to figure out, the program runs fine sometimes and crashes or infinite loops other times. when it lets me debug, it points me to the line:
i'll attach the cpp file, header file, and data file on hereCode:void leftrotate(Ptr& root, Ptr& x) { Ptr y=x->right; //new Ptr y = right[x] Ptr spare=x; x->right=y->left; //right[x]=left[y]