public static void Main(string[]args)
Tasks tasks = new Tasks();
tasks.InsertTask(new Task("משימה בהולה 1", 1));
tasks.InsertTask(new Task("משימה דחופה 1", 2));
tasks.InsertTask(new Task("משימה רגילה 1", 3));
Task nextTask = tasks.GetNextTask();
public Task (string content, int code)
public void SetCode(int code)
public string GetContent()
public void SetContent(string content)
private Stack<Queue<Task>> tasks = new Stack<Queue<Task>>();
private Queue<Task> panicTask = new Queue<Task>();
private Queue<Task> urgentTask = new Queue<Task>();
private Queue<Task> normalTask = new Queue<Task>();
public void InsertTask (Task task)
else if (task.GetCode() == 2)
else if (task.GetCode() == 3)
public Task GetNextTask()
if (!panicTask.IsEmpty())
nextTask = this.panicTask.Remove();
else if (!urgentTask.IsEmpty())
nextTask = urgentTask.Remove();
else if (!normalTask.IsEmpty())
nextTask = normalTask.Remove();
public Node (T value, Node<T> next)
public void SetValue (T value)
public void SetNext(Node<T> next)
return this.next != null;
public override String ToString()
return this.value.ToString();
this.first=new Node<T> (x,this.first);
T x=this.first.GetValue();
this.first=this.first.GetNext();
return this.first.GetValue();
public override String ToString()
Node<T> pos = this.first;
str=str+pos.GetValue().ToString();
Node<T> temp = new Node<T>(x);
T x=this.first.GetValue();
this.first=this.first.GetNext();
return this.first.GetValue();
public override String ToString ()
Node<T> pos = this.first;
str=str+pos.GetValue().ToString();
private BinNode<T> right;
public BinNode (BinNode<T> left, T x, BinNode<T> right)
public BinNode<T> GetLeft()
public BinNode<T> GetRight()
public void SetValue(T x)
public void SetLeft(BinNode<T> left)
public void SetRight(BinNode<T> right)
public override String ToString ()
return this.value.ToString();