Question
What is the time complexity of the peek operation
(accessing the top element without removing it) in a stack implemented using a singly linked list?Solution
In a singly linked list implementation of a stack, the top of the stack is typically represented by the head of the list. Accessing the head element (peek operation) takes constant time, O(1).
- The year next to 2014 will have the same calendar as that of the year _________.
- If it was Sunday on 13 th March 2019, then what was the day on 2 nd June 2019?
The mirror image of a clock shows a time of 3:28 hrs. What is the time shown in the clock?Â
Day before yesterday is Rahini’s birthday. On the same day next week falls ‘Janamasthmi’. Today is Saturday what will be the day after ‘ Janamas...
- It was Thursday on February 8, 2024, then, what will be the day on February 8, 2028?
If it was Saturday on 1 st October, 2022. What will be the day on 19 th April, 2023?
What is the angle between the minute hand and the hour hand at 3:24hrs when taken in anticlockwise direction from the minute hand?
If it was Sunday on 1st February 2020, then what was the day on 1st October 2020?
It was Friday on 1st March, 2024. What will be the day on 1st March, 2029?
- What was the day of the week on ‘9th November 1998’?