Function to find the first non - repeating element of the given string using Linked List
static void firstNonRepElement ( string str ) { LinkedList < char > list = new LinkedList < char > ( ) ; list . AddLast ( str [ 0 ] ) ; for ( int i = 1 ; i < str . Length ; i ++ ) { if ( list . Contains ( str [ i ] ) ) list . Remove ( str [ i ] ) ; else list . AddLast ( str [ i ] ) ; } Console . Write ( list . First . Value ) ; }