Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Collections; //using when want to use arraylist
- namespace MQueue
- {
- class MQueue
- {
- ArrayList list;
- public MQueue() { list = new ArrayList(); }
- public void enqueue(string message) {
- list.Add(message);
- }
- public string dequeue() {
- string message = (string)list[list.Count - 1];
- list.RemoveAt(list.Count - 1);
- return message;
- }
- public bool isempty() {
- return list.Count==0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement