Design an algorithm that, given two strings of characters, tests whether the ?rst string appears as a substrin?
string s plus s2 regarding i=0 to s2.length if(s.charAt(0)==s2.charAt(i)) j=0; while(true) if(j==(s.length-1) //yes seems like as your string if(s.charAt(j)==s2.charAt(j)) j++; other than them separate; upcoming i Shame giving you for not really mentioning terminology, and then giving somebody optimum solution just simply because picked the best one PITY SHAME DISGRACE …