Challenge 3: Reversing First "k" Elements of Queue
Can you reverse the first "k" elements in a given queue?
Problem statement
Implement the function myQueue reverseK(myQueue queue, int k)
, which takes a queue and a number k
as input and reverses the first k
elements of the queue.
Input
The input is a queue and an integer k
such that
0 ...
Access this course and 1400+ top-rated courses and projects.