Question: Test your programs by running them on MARS. Write and test a MIPS assembly language program to determine the longest common prefix ( LCP )
Test your programs by running them on MARS.
Write and test a MIPS assembly language program to determine the longest common prefix LCP between two given strings.
The program should compare two strings character by character and return the longest common prefix. If no common prefix exists, return an empty string. You can consider the strings as predefined inputs in the data section.
Example:
Given the strings:
String : "abcdef"
String : "abcxyz"
The longest common prefix is: "abc".
Once tested, submit your asm file after running it using the MARS Simulator.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
