Anonymous
BAN USER- 0of 2 votes
Answerswrite a code to print the second largest element in a list
- Anonymous in United States
Shortest possible complexity.| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Algorithm Data Structures - 0of 0 votes
Answersthere is a log file which contains info in below format:
- Anonymous in United States
timestamp : customer-id : page-id
repeat customers are customers who return to the amazon site(any page) after at least a day.
write a code to print all the repeat customers| Report Duplicate | Flag | PURGE
Amazon Intern - 0of 0 votes
AnswersThere is a class
- Anonymous in United States
class vehicle
{
int door_numbers;
obj colour;//another class has int members Red, Green,Blue
bool has_ac;
}
there is a huge list of data of vehicles, the number of doors may vary to 1-million (imaginary vehicle :) ).
there may be millions of colors.vehicle may or may not have AC. How would you save this such that any combination
(say all blue cars with ac having 6 doors) may be accessed easily.
Discuss algorithm, complexity and testing strategy| Report Duplicate | Flag | PURGE
Student student Student student Algorithm Data Structures
Virtual member functions are inherited. A class derived from an abstract base class will also be abstract unless you override each pure virtual function in the derived class.
for example: -
class base
{
public:
virtual void makevirtual()=0;
};
class derived:public base
{
};
here, derived has no virtual function and is still an abstract class
- Anonymous October 24, 2013
Assuming there can be more than 1 three set sequences:
- Anonymous January 07, 2014have a hash table with key as a string (based on sequence of pages, say strcat of the 3) and value as count(integer value).
have a struct having 2 elements-integer value for max count and vector of strings for the 3 page sequence.
if key exists in hashmap increase count, else add to map with value as 1
if (hashmap_count>struct_count)
{
//first call vector.erase
//update struct_count value
// then push back the new sequence string
}
else if (hashmap_count==struct_count)
//push back this string also to the vector. no need to worry about duplicate as it will never happen