I need to convert this code into mips assembly. Preferably this exact search alg
ID: 3659162 • Letter: I
Question
I need to convert this code into mips assembly. Preferably this exact search algorithm but if its too complicated i would take any string search algorithm that i could run in a mips assembler. int StrLen( const char* str ) { const char* ptr = str; for ( ; 1; ++ptr ) { if ( *ptr == '' ) return ptr - str; } } #define MAX_S 101 /** max text length 100 **/ #define MAX_P 21 /** max pattern length 20 **/ char s[MAX_S]="HERE IS A SIMPLE EXAMPLE", p[MAX_P]="EXAMPLE"; /** s is text; p is pattern **/ int nextv[MAX_P]; /** p's nextv array **/ void init_nextv() { int i = 0, j = -1; int p_len; /** pattern length **/ p_len = StrLen(p); nextv[0] = -1; while (iExplanation / Answer
its very difficult to understand the question as data is not clear... post the question rather in a proper tables or images so dat i can solve it and give u the best possible answer...
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.