abhishek18garg
Questions (2)
Comments (2)
Reputation 0
- 31
0of 0 votes
Answerstwo BST are given find common elements in both....
- abhishek18garg on September 09, 2012 in India for idc Edit | Report Duplicate | Flag
Microsoft Intern Trees and Graphs - 19
0of 0 votes
Answersgiven s string "1010101010" in base2 convert it into string with base4.not use extra space....
- abhishek18garg on September 09, 2012 in India for idc Edit | Report Duplicate | Flag
Microsoft Intern String Manipulation
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
all codes having time complexity O(n^2) anyone with efficient approach
...
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
#include<stdio.h>
- abhishek18garg on September 11, 2012 Edit | Flag View Reply#include<strings.h>
char exploreString(char str[],int k)
{
int i=0;
int current=0;
int l=strlen(str) ;
for(i=0;i<l;i++)
{
if(str[i]>47 &&str[i]<55)
{
current+=str[i]-'0' ;
if(k<=current)
return str[i-1] ;
}
}
printf("k is not in string\n") ;
}
void main()
{
char str[50],ch ;
int k;
printf("enter the string\n") ;
scanf("%s",str) ;
printf("enter the number\n") ;
scanf("%d",&k) ;
ch=exploreString(str,k) ;
printf("%c",ch) ;
}