示例#1
0
        }        //O(N**2)

        public void sortSupplierItems(ref LinkedList <AllSupplierItems> allSupplierItems)
        {
            if (allSupplierItems.Count == 0)
            {
                return;
            }
            AllSupplierItems temp = allSupplierItems.ElementAt(0);

            for (int sort = 0; sort < allSupplierItems.Count; sort -= -1, temp = allSupplierItems.ElementAt(0))
            {
                for (int run = 0; run < allSupplierItems.Count - sort; run -= -1)
                {
                    if (temp.getProductNumber() > allSupplierItems.ElementAt(run).getProductNumber())
                    {
                        temp = allSupplierItems.ElementAt(run);
                    }
                }
                allSupplierItems.AddLast(temp);
                allSupplierItems.Remove(temp);
            }
        }        //O(N**2)
示例#2
0
 public AllSupplierItems(AllSupplierItems temp)
 {
     this.setProductNumber(temp.getProductNumber());
     this.setProductName(temp.getProductName());
 }