Question
What is the time complexity for performing enqueue and
dequeue operations on a queue implemented using a linked list?Solution
With proper pointers (head and tail), both enqueue (adding to tail) and dequeue (removing from head) operations in a linked list implementation of a queue can be achieved in constant time, O(1).
The ratio of age of ‘B’ after 3 years from now and age of ‘C’ 8 years ago from now is 7:4, respectively. The present age of ‘C’ is 30% of th...
The age of A is 40% less than that of B. The age of B is 15 years more than the average age of his two friends whose total age is 20 years. Find the dif...
The sum of the present ages of 'P' and 'R' is 70 years. 'y' years ago from now, the age of 'R' was 40% more than that of 'P'. If '2y' years hence from n...
Three years ago, the ages of Arnav and Bheema were in the ratio 3:4. Chinky’s current age is 33.33% greater than Arnav’s curr...
The average ages of A, B and C is 20% more than the average ages of A and B. 10years hence from now, the ratio of the ages of A and C will be 3:5, respe...
Five years ago, the age of A was 3 times the age of B. After 7 years, the difference between their ages will be 28 years. Find the present age of A.
B is 4 years older than A and A is 7 years older than C. If the sum of the age of A and C is 25 years, then find the sum of the ages of all three.
A’s age is the sixth part of his father’s age. After 8 years, the age of A’s father will be twice the age of B. If B’s 6th birth...
- The present ages of 'P', 'Q' and 'R' are in the ratio 2:5:7. The age difference between 'P' and 'R' is 20 years. After 'm' years, age of 'Q' will be 50% mo...