KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Can the performance of this sequential search algorithm (taken from The Practice of Programming ) be improved using any of C's native utilities, e.g. if I set the i variable to be a register variable ? int lookup(char *word, char*array[]) { int i for (i = 0; array[i] != NULL; i++) if (strcmp(word, array[i]) == 0) return i; return -1; }
Tags (comma-separated)
Save Edits
Cancel