Guest_imported
New member
- Jan 1, 1970
- 0
Alright, hopefully this will be easy. I'm creating an integer heap (for a priority queue). However, I do not know if it's a high-num high-pri or a low-num high-pri until the user tells me so. Is there a way to interpret a char variable as an operator? Say, for example, char top_op = '<'; is there some way I could test
if(heap_array[2*n+1] **some function of top_op** heap_array[2*n+2]) ?
Thanks for any help.
sjm
if(heap_array[2*n+1] **some function of top_op** heap_array[2*n+2]) ?
Thanks for any help.
sjm