Example #1
0
 private void btnSearch_Click(object sender, System.EventArgs e)
 {
     if (!"".Equals(txtNumber.Text))
     {
         TreeHandler.getInstance().insert(txtNumber.Text);
     }
 }
Example #2
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            TreeHandler th = TreeHandler.getInstance();

//
//			th.addTree(StructureType.AVL,1);
            th.addTree(StructureType.B, 1);
//			th.addTree(StructureType.BINARY,1);
        }
Example #3
0
 private void ckbSplay_CheckedChanged(object sender, System.EventArgs e)
 {
     if (ckbSplay.Checked)
     {
         AbstractBinaryTree binaryTree = (AbstractBinaryTree)TreeHandler.getInstance().addTree(StructureType.SPLAY, 1);
         BinaryView         splayView  = new BinaryView(binaryTree);
         splayView.MdiParent = this;
         views.Add(splayView);
         insert();
         splayView.Show();
     }
 }
Example #4
0
        private void insert()
        {
            TreeHandler th = TreeHandler.getInstance();

            th.insert("60");
            th.insert("50");
            th.insert("30");
            th.insert("40");
            th.insert("55");
            th.insert("58");
            th.insert("80");
            th.insert("75");
            th.insert("45");
            th.insert("10");
            th.insert("05");
            th.insert("57");
            th.insert("42");
        }
Example #5
0
        private void btnInsert_Click(object sender, System.EventArgs e)
        {
            TreeHandler.getInstance().insert(txtNumber.Text);
            foreach (IView view in views)
            {
                view.draw();
            }
//			tree2.insertKey(new Key(textBox1.Text));
//
//			Graphics graph = panel1.CreateGraphics();
//			graph.DrawLine(new Pen(Color.DarkBlue),panel1.Bounds.Width/2,0,panel1.Bounds.Width/2,30);
//
//			graph.FillRectangle(new Pen(Color.DarkBlue).Brush,panel1.Bounds.Width/2-9*s.Length/2,30,9*s.Length,13);
//			graph.DrawRectangle(new Pen(Color.White),0,0,9*s.Length,13);
//			//Image(Image.FromFile(Application.StartupPath + "\\img\\img-1.bmp"), 0, 0);
//			graph.DrawString(s.ToUpper(),new Font("Verdana", 8,FontStyle.Bold), new Pen(Color.White).Brush,0,0);
//
//			graph.FillRectangle(new Pen(Color.DarkBlue).Brush,0,39,9*s.Length,13);
//			graph.DrawRectangle(new Pen(Color.White),0,39,9*s.Length,13);
//			//Image(Image.FromFile(Application.StartupPath + "\\img\\img-1.bmp"), 0, 0);
//			graph.DrawString(s.ToUpper(),new Font("Verdana", 8,FontStyle.Bold), new Pen(Color.White).Brush,0,39);
        }
Example #6
0
 private void btnDelete_Click(object sender, System.EventArgs e)
 {
     TreeHandler.getInstance().delete(txtNumber.Text);
 }