Problem algorithm or data structure with conventional solutions

Question 1 contains four billion random permutation of integer file 32 to find out whether there is a digital

  Solution: Bitmap law


 


 

2 prosequence 123456 problem, how to achieve fast compilation of left or right shift operator

  Solution: Three flip

  For example 123456-> 456123 

  The first step requires: reverse (123) Step: reverse (456) Third step: reverse (321654);

  Mathematics level (the X- T the Y- T ) T = (YX) it

 


 


Question 3 quickly find a number (must be ordered) in an ordered sequence, it can quickly become disorderly and orderly   

  Solution: binary search algorithm complexity of the algorithm (logn)


Question 4 

 

Guess you like

Origin www.cnblogs.com/cpulspulsstudy/p/11240192.html