Here I have two solutions to find if a srting is a Palindrome. The first one uses Recursion and the second one uses for loop. I am little confused how my code with Recursion would perform vs. the code without recursion. Does the code with Recursion run in O(n) time? If so, how?

```
//Solution using recursion
function isPalindrome(arr) {
    //Runs on first call only
    if (typeof arr === "string"){
        //remove whitespace
        if(arr.match(/\s/)) {
            arr = arr.replace(/\s/g, "");
        }
        //convert to array
        arr = arr.split("");
    }

    //base condition
    if(arr.length === 0 || arr.length === 1) {
        //console.log(true);
        return true;
    } else {
        if (arr[0] !== arr[arr.length - 1]) {
            //console.log(false);
            return false;
        } else {
            arr.shift(); //remove first element
            arr.pop(); //remove last element

            //recursive call
            isPalindrome(arr);
        }
    }
}

//Solution without using recursion
function palindrome(str) {
    var reverseString = [];
    //remove whitespace
    if(str.match(/\s/)) {
        str = str.replace(/\s/g, "");
    }
    //convert to array
    var arr = str.split("");

    for(var i = arr.length; i > 0; i--) {
        reverseString.push(arr.pop());
    }

    if (reverseString.join("") === str) {
        return true;
    } else {
        return false;
    }

}

console.log(palindrome("racecar"));
console.log(palindrome("si racecar is"));

```