Category: Basic

Implement strstr function in Java

Write an efficient algorithm to implement strstr function in Java which returns the index of first occurrence of a string in another string.

Implement substr function in C

Write an efficient function to implement substr function in C. substr() function returns the substring of given string between two given indices.

Implement strcmp() function in C

Write an efficient function to implement strcmp function in C. Standard strcmp() function compares the two strings and returns an integer indicating the relationship between the two strings.

Implement strncat() function in C

Write an efficient function to implement strncat function in C. Standard strncat() function appends appends first num characters of given C-string to the another string.

Implement strcat() function in C

Write an efficient function to implement strcat function in C. Standard strcat() function appends a copy of the given C-string to the another string.