Popular posts from this blog
Use of Recursion
//cheak sorted array or not #include<iostream> using namespace std; bool check(int arr[],int n) { if (arr[n-2]==arr[0]) {return 1;} if(arr[n-1]>arr[n-2]) { return check(arr,n-1) ;} else{ return 0;} } // write the sequence of decnbr void decnmbr (int n) { cout<<n<<" "; if(n==0){return;} decnmbr(n-1); } // find first occurance int firstoccurance (int a[],int n,int key,int i) { if(i>n) {return -1;} if(a[i]==key) {return i;} firstoccurance( a,n,key,i+1); } //find last occurrence...
Comments
Post a Comment
If you have any doubt ,let me know