Open main menu

CDOT Wiki β

Changes

ParaCode

622 bytes added, 11:09, 6 April 2018
Assignment 2
With the same idea, we can find 'a':<br>
[[File:FindA.JPG|650px]]
 
What's next??
 
We create an integer array. The size of this array is the same as input's size. This array is to record the characters exist in that position. If characcter exist, we mark it as specific number. Wecall this array as band.<br>
 
First, we initialize all integers as '0'. This means all characters in keyword are not found in that position in input.<br>
[[File:Initial.JPG|650px]]
 
Then, we start to find keyword's characters in input string. For example, we want to find 'h'. As 'h' is the first character in keyword, we will mark it '1' in the integer array 'band'. Like this:<br>
[[File:Mark1.JPG|650px]]
=== Assignment 3 ===
167
edits