<commit_before>//
//  recursion.cpp
//  DS
//
//  Created by <NAME> on 7/26/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

#include "recursion.hpp"

//As Its not suggestable to return local variable outside the function So use this array in case you need to return Array or list of elements
static int *arrayTmp;

int recursion_SumOfNumbersFromList(int *arr, int size){
    if (size <= 0){
        return arr[size];
    }else{
        return arr[size] + recursion_SumOfNumbersFromList(arr,size - 1);
    }
}


int recursion_SumOfNNaturalNumbers(int upto){
    if (upto <= 0){
        return 0;
    }else{
        return upto + recursion_SumOfNNaturalNumbers(upto - 1);
    }
}


int recursion_numberOfChars( char *str){
    
    if (*str == '\0'){
        return 0;
    }
    else{
        return  1 + recursion_numberOfChars(str + 1);
    }
}

void recursion_reverseOfString(char *str, int index){
    if (str[index] == '\0'){
        return ;
    }else{
        recursion_reverseOfString(str, ++index);
        printf("%c",str[index]);
    }
}

int recursion_power(int number, int power){
    if (power <= 0){
        return 1;
    }else{
        return number*recursion_power(number, power-1);
    }
}


int* recursion_getAllWordsFromSentence(char *str,char *ptr){
    
    //In case sentence ends
    if (*str == '\0'){
        return arrayTmp;
    }else{
    
        //In case of Sapce
        if (*str == ' '){
            
        }
        return recursion_getAllWordsFromSentence(str + 1,ptr);
    }
    
    return arrayTmp;
}
<commit_msg>changes for recursion added<commit_after>//
//  recursion.cpp
//  DS
//
//  Created by <NAME> on 7/26/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

#include "recursion.hpp"

//As Its not suggestable to return local variable outside the function So use this array in case you need to return Array or list of elements
static int *arrayTmp;

int recursion_SumOfNumbersFromList(int *arr, int size){
    if (size <= 0){
        return arr[size];
    }else{
        return arr[size] + recursion_SumOfNumbersFromList(arr,size - 1);
    }
}


int recursion_SumOfNNaturalNumbers(int upto){
    if (upto <= 0){
        return 0;
    }else{
        return upto + recursion_SumOfNNaturalNumbers(upto - 1);
    }
}


int recursion_numberOfChars( char *str){
    
    if (*str == '\0'){
        return 0;
    }
    else{
        return  1 + recursion_numberOfChars(str + 1);
    }
}

void recursion_reverseOfString(char *str, int index){
    if (str[index] == '\0'){
        return ;
    }else{
        recursion_reverseOfString(str, ++index);
        printf("%c",str[index]);
    }
}

int recursion_power(int number, int power){
    if (power <= 0){ //In Case pow(number,0) = 1
        return 1;
    }else{
        return number*recursion_power(number, power-1);
    }
}


int* recursion_getAllWordsFromSentence(char *str,char *ptr){
    
    //In case sentence ends
    if (*str == '\0'){
        return arrayTmp;
    }else{
    
        //In case of Space
        if (*str == ' '){
            
        }
        return recursion_getAllWordsFromSentence(str ,ptr+1);
    }
    
    return arrayTmp;
}

void reverseWordAndAddItToArray(char *str,int length){
    
}


{'fraction_non_alphanumeric': 0.12581344902386118, 'fraction_numerical': 0.015494267121165169, 'mean_word_length': 2.3485477178423237, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1464378', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1054, 'n_words': 291}