Ejemplo n.º 1
0
        public void HoarePartitionTest()
        {
            // 1 2 4 10 8 7 12 9 15
            List <int> partitionList = new List <int>()
            {
                4, 1, 10, 8, 7, 12, 9, 2, 15
            };
            int pivotIndex   = 2;
            int pivotIndexEx = Partitioning.HoarePartition(partitionList, 0, partitionList.Count - 1);

            Assert.Equal(pivotIndex, pivotIndexEx);
        }