I have been out of touch with Algorithms for a while and have start revising my concepts these days. To my surprise the last i remember of my recursions skill was that i was goo
Run this piece of code to understand recursion well.I have considered the stack depth in the console.Hope it makes it easy to understand!
#include "stdafx.h"
#include
using namespace std;
static int stackdepth=0;
void mergesort(int[],int,int);
void merge(int[],int,int,int);
void space(int);
int main(int argc,char *argv[])
{
int a[8]={5,7,1,4,9,3,2,0};
mergesort(a,0,7);
for(int i=0;i<10;i++)
// cout<