ayushsethi22031992
BAN USER- -1of 3 votes
AnswersProblem Statement: A child is arranging rocks in layers. He can arrange the rocks, in such way that, any layer has lesser rocks than its base layer. Given n rocks, In how many ways can the child arrange the rocks.
- ayushsethi22031992 in India| Report Duplicate | Flag | PURGE
Developer Program Engineer Algorithm
a brute force approach might work here... but first we need a dictionary to tell us where to break from???
now when we have got the word... there can be 2 cases-either this is the only word present in the dictionary ,in that case just place a space between.... if that found substring is a part of some other strings as well.. then... we need to keep the record of previous pointer and keep incrementing pointer... if the match is succsfll.. break it from the new ;position or else break it from the previous one!!!!
serving a web page to a client can mean 2 diffrt things... the first is that we knoe the address of the page that we are searching for...dns will give us the reqd ip adress... arp and rarp will look for that ip address.... and the second and a little complex is searching via a search engine.. a search engine has 3 parts.. the first one is crawler.. it comprise of huge number of computers that crawl through millions of pages on a daily basis.. delete pages that have expired and add the new ones in the index... then comes indexing the web pages that are found by crawler.... this is one with the help of hundreds of factors.. the metric used for measuring importance of a web page is PAGE RANK.. the bettr rank.. the relevant ur page is to that query.. this is indexing.....atlast is serving the desired pages... this is again based on page rank... more relevant pages are displayed first..
- ayushsethi22031992 September 29, 2013both the lines are correct provide some initial value for i... here i++ is a post increment operator where value is assigned first and then incremented.whereas ++i is a pre increment operator where value is incremented and then assigned.
- ayushsethi22031992 September 10, 2013function for the solution is given below,it solves the problem in O(n) time:
int arrange_numbers(int *ARRAY,int no_of_elements)
{
int NEW_ARRAY[no_of_elements];
int i,j=0;
for(i=0;i<no_of_elements;i++)
{
if(*ARRAY <0 )
{
NEW_ARRAY[j] = *ARRAY;
j++;
}
ARRAY++;
}
// loop 1 ends,arrangin all negative numbers correctly;
}
for(i=0;i<number_of_elements;i++)
{
if(*ARRAY > 0)
{
NEWARRAY[j]=*A;
j++;
}
ARRAY++;
}
//loop 2 ends arranging all positive numbers correctly
return NEW_ARRAY;
}
6 bits.. bcz.. on an 8x8 chess board... there can be 64 boxes... thus... in the worst case... we need atleast 6 bits.. to distinguish all d boxes dintinctly
- ayushsethi22031992 August 28, 2013
Repmarkhmitchell6, Analyst at ASAPInfosystemsPvtLtd
At first, tattooing was a hobby kind of thing for me. I didn’t spend too much time in tattoo ...
RepAmberBrook, Animator at A9
Hi everyone, Done my master of arts in specialized journalism.Also an member of society of professional journalists since 2015 ...
we can do this in O(n).. by frequency measuring... just note the frequencies of all the elemnts.. this can be done in O(n) time and then check the whole array if the frequency is 1 or not.. O(n) time.. thus checked!
- ayushsethi22031992 November 03, 2014for(i=0;i<n;i++)
{
arrfreq[arrnumbrs[i]]++;
}
for(i=0;i<rangeofnumbers;i++)
{
if(arrfreq[i]==1)
printf("i");
break;
}