function [DNA1, DNA2] = onePointCrossOver_(DNA1,DNA2,crossOverPoint)
% perform a one-point crossover operation of 2 equal length strings(DNA).
% generate 2 new string(DNA) sequences.
% K. Ming Leung, Nov. 14, 2008
lengthDNA = length(DNA1);
% The string may be exremely long.
% Need to minimize the amount of copying.
if crossOverPoint < lengthDNA/2             % swap the first portion
    IdxLeft = 1:crossOverPoint;
    Temp = DNA1(IdxLeft);
    DNA1(IdxLeft) = DNA2(IdxLeft);
    DNA2(IdxLeft) = Temp;
else                                        % swap the last portion
    IdxRight = crossOverPoint+1:lengthDNA;    
    Temp = DNA1(IdxRight);
    DNA1(IdxRight) = DNA2(IdxRight);
    DNA2(IdxRight) = Temp;
end




