• 算法.冒泡和二分查找


    public static void SortOrder(int[] arrlist)
            {
                int temp;
                for (int i = arrlist.GetUpperBound(0); i >= 1; i--)
                {
                    for (int j = 0; j < arrlist.GetUpperBound(0) - 1; j++)
                    {
                        if (arrlist[j] > arrlist[j + 1])
                        {
                            temp = arrlist[j];
                            arrlist[j] = arrlist[j + 1];
                            arrlist[j + 1] = temp;
                        }

                    }
                }

            }

            public static int binarySearchBad(int[] arr, int value)
            {
                int low = 0, high = arr.Length - 1;
                int middle;
                while (low <= high)
                {
                    middle = (high +low) / 2;

                    if (value == arr[middle])
                    {
                        return middle;

                    }
                    if (value > arr[middle])
                    {
                        low = middle + 1;
                    }
                    if (value < arr[middle])
                    {
                        high = middle - 1;
                    }
                }
                return -1;
            }

  • 相关阅读:
    HTTP协议
    安全测试-渗透性测试
    网络安全、Web安全、渗透测试之笔经面经总结(三)
    Struts2拦截器再认识
    struts2.5+框架使用通配符与动态方法
    struts.xml配置详解
    代理概述
    Mybatis Plugin(拦截器)的开发
    详解环境搭建SSM
    mybatis-databaseIdProvider多数据库支持
  • 原文地址:https://www.cnblogs.com/cxlings/p/2773780.html
Copyright © 2020-2023  润新知