title: How do i find if its a repeating playlist?
body: <p>I need to find if the playlist is repeating. From my below code pls help to suggest a solution.
  A playlist is considered a repeating playlist if any of the songs contain a reference to a previous song in the playlist. Otherwise, the playlist will end with the last song which points to null.</p>
  
  <pre><code>using System;
  
  public class Song
  {
      private string name;
      public Song NextSong { get; set; }
  
      public Song(string name)
      {
          this.name = name;
      }
  
      public bool IsRepeatingPlaylist()
      {
          if(this.name == NextSong.name)
          {
              return true;
          }
          else
          {
              return false;
          }
      }
  
      public static void Main(string[] args)
      {
          Song first = new Song("Hello");
          Song second = new Song("Eye of the tiger");
  
          first.NextSong = second;
          second.NextSong = first;
  
          Console.WriteLine(first.IsRepeatingPlaylist());
      }
  }
  </code></pre>