Statistics Help
Question: Which of the following statement is false about this computational problem. move all the zeros in array of n number to the left end of the array Edit
Answer: Without creating a new array you can iterate over your current array backwards and when you encounter a zero swap it with the last element of your array. You'll need to keep a count of the number of zero elements swapped so that when you swap for a second time, you swap with the last-1 element, and so forth.
[D] This problem can be solved by an algorithm in logn step or operation
Edit
TutorTeddy.com & Boston Predictive Analytics
[ Email your Statistics or Math problems to help@teddycan.com (camera phone photos are OK) ]
Boston Office (Near MIT/Kendall 'T'):
Cambridge Innovation Center,
One Broadway, 14th Floor,
Cambridge, MA 02142,
Phone: 617-395-8864
Dallas Office (Near Galleria):
15950 Dallas Parkway,
Suite 400,
Dallas, TX 75248,
Phone: 866-930-6363