Calculate 1+2+…+n without multiplication, division, key words for, while, if, else, switch, case, as well as conditional operator (A ? B : C).
here is the sample code of problem : a=100000000,b=200000; multiplication=1; while(a--){ multiplication=multiplication*b; } printf "multiplication= result" reduce the time complexity by giving a suitable example which must have less complexity than this for large numbers.
Given two n-node trees, how many rotations does it take to convert one tree into the other?
List => 1 2 3 4 5 6 7 8 9
N=3 Out Put => 1 2 3 6 5 4 7 8 9 N=4 Out Put => 1 2 6 5 4 3 7 8 9 N=5 Out Put => 1 2 7 6 5 4 3 8 9
Give a good data structure for having n queues (n not fixed) in a finite memory segment. You can have some data-structure separate for each queue. Try to use at least 90% of the memory space.