6 kyu

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.

Fundamentals
Object-oriented Programming

Stats:

CreatedJul 24, 2016
PublishedJul 24, 2016
Warriors Trained541
Total Skips24
Total Code Submissions787
Total Times Completed204
C# Completions204
Total Stars13
% of votes with a positive feedback rating93% of 45
Total "Very Satisfied" Votes40
Total "Somewhat Satisfied" Votes4
Total "Not Satisfied" Votes1
Total Rank Assessments7
Average Assessed Rank
6 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • aryan-firouzian Avatar
  • dcieslak Avatar
  • hobovsky Avatar
Ad