get.santhoshkrishna
BAN USER- 0of 0 votes
AnswersYou have an API to predict stock values of a particular share,
- get.santhoshkrishna in India
The API is
StockPrediction predict(int stockid);
where
class StockPrediction{
Date time:
float value;
}
using this API develop another API which will suggest the best selling time and buying time of a share (you have to call the predict API N number of times and from the StockPredictions provide the best buy time and sell time for the stock)
Your API can be BestTiming getBestTiming(int stockid);
where
class BestTiming{
StockPrediction bestselltime:
StockPrediction bestbuytime:
}
eg
values --> 10 12 7 8 24 35 1 9
time -----> 9am 9.30 9.45 10am 11am 12am 3am 4am
out put : buy the stock at 7 rs at 9.45 and sell it for 35 rupees at 12am
(hint: go for the best solution which uses only three variable to get this result)| Report Duplicate | Flag | PURGE
InMobi Algorithm - 0of 0 votes
AnswersInteger Array A of size N. Your job is to fill integer array B of size N where B[i] = products of all elements in A except the one at index i.
- get.santhoshkrishna in India
Simple solution prod = product of all elements in A
B[i] = prod/A[i]
Now to make it an interesting problem, can you solve it without using division operation?| Report Duplicate | Flag | PURGE
InMobi Algorithm - 0of 0 votes
AnswersWrite a java program to do the breadth first search of a graph.
- get.santhoshkrishna in United States| Report Duplicate | Flag | PURGE
InMobi Java Trees and Graphs - 0of 0 votes
Answersunsorted integer array with values 1 to N-1 has one duplicate element in it.
- get.santhoshkrishna in India
(N is the size of the array. max value is N-1 because of the duplicate element.)
Best way to find the duplicate element? If possible O(log n)| Report Duplicate | Flag | PURGE
InMobi Algorithm