Generic-type Loop
Description:
You have seen many generic-type collections like Lists. When you want to use a List, you can create it for any type like List of int, List of string, List of arrays or ...
Your task is easy; you have to create a customized generic class named Loop; (it is a closed loop like a circle to rotate left and right)
It has specific functionalities:
You can add objects to it. It adds the object to the end of the Loop. The loop can also use collection initializer. (like a List)
You can rotate it to the Right or Left. So the end and beginning of the loop are changed. I refer the test case to see more details.
You can ShowFirst or PopOut the first item. Show just return the first item, while PopOut returns the first item while removing it from the loop.
There is no situation to face empty list. You don't need to handle any exception.
Similar Kata:
Stats:
Created | Jul 24, 2016 |
Published | Jul 24, 2016 |
Warriors Trained | 541 |
Total Skips | 24 |
Total Code Submissions | 787 |
Total Times Completed | 204 |
C# Completions | 204 |
Total Stars | 13 |
% of votes with a positive feedback rating | 93% of 45 |
Total "Very Satisfied" Votes | 40 |
Total "Somewhat Satisfied" Votes | 4 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 7 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 3 kyu |
Lowest Assessed Rank | 7 kyu |