Queue Operations

using System;using System.Collections.Generic;public class GFG {     public class Geeks {           public void insert(Queue q, int k)    {                q.Enqueue(k);    }            public int findFrequency(Queue q, int k)    {                int cntFrequency = 0;                int size = q.Count;                while (size– != 0) {                                    int x = q.Peek();            q.Dequeue();                                    if (x == k) {                                cntFrequency++;            }                                    q.Enqueue(x);        }                return cntFrequency;    }}        public static void Main()    {                       Queue q = new Queue();        int N = 8;        int[] a = new int[] { 1, 2, 3, 4, 5, 2, 3, 1 };        int M = 5;        int[] b = new int[] { 1, 3, 2, 9, 10 };                Geeks obj = new Geeks();        for (int i = 0; i < N; i++)        {                                               obj.insert(q, a[i]);        }        for (int i = 0; i < M; i++)        {                                   int f = obj.findFrequency(q, b[i]);            if (f != 0)            {                                                               Console.Write(f + " ");            }            else {                Console.Write("-1"                                 + " ");            }        }    }}