中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

移動(dòng)網(wǎng)站開發(fā)實(shí)訓(xùn)報(bào)告泉州百度seo公司

移動(dòng)網(wǎng)站開發(fā)實(shí)訓(xùn)報(bào)告,泉州百度seo公司,php做網(wǎng)站后臺(tái)有哪些框架,百度推廣網(wǎng)站怎么做歸并排序 歸并算法采用非常經(jīng)典的分治策略,每次把序列分成n/2的長(zhǎng)度,將問題分解成小問題,由復(fù)雜變簡(jiǎn)單。 因?yàn)槭褂昧诉f歸算法,不能用于大數(shù)據(jù)的排序。 核心代碼: using System; using System.Text; using System.Co…

歸并排序

歸并算法采用非常經(jīng)典的分治策略,每次把序列分成n/2的長(zhǎng)度,將問題分解成小問題,由復(fù)雜變簡(jiǎn)單。

因?yàn)槭褂昧诉f歸算法,不能用于大數(shù)據(jù)的排序。

核心代碼:

using System;
using System.Text;
using System.Collections.Generic;
using System.Windows.Forms;

namespace WindowsFormsApp6
{
? ? public partial class Form1 : Form
? ? {
? ? ? ? Random rnd = new Random((int)DateTime.Now.Ticks);
? ? ? ? List<string> slides = new List<string>();

? ? ? ? public Form1()
? ? ? ? {
? ? ? ? ? ? InitializeComponent();
? ? ? ? ? ? BrowserReleaseHelper.SetWebBrowserFeatures(11);
? ? ? ? }

? ? ? ? private void Form1_Load(object sender, EventArgs e)
? ? ? ? {
? ? ? ? ? ? this.Text = "C#,四種常見排序算法的可視化編程——北京聯(lián)高軟件開發(fā)有限公司";
? ? ? ? ? ? button1.Text = "選擇排序"; button1.Cursor = Cursors.Hand;
? ? ? ? ? ? button2.Text = "冒泡排序"; button2.Cursor = Cursors.Hand;
? ? ? ? ? ? button3.Text = "插入排序"; button3.Cursor = Cursors.Hand;
? ? ? ? ? ? button4.Text = "快速(遞歸)"; button4.Cursor = Cursors.Hand;
? ? ? ? ? ? button5.Text = "快速(非遞歸)"; button5.Cursor = Cursors.Hand;
? ? ? ? ? ? button6.Text = "歸并排序"; button6.Cursor = Cursors.Hand;
? ? ? ? ? ? panel1.Dock = DockStyle.Top;
? ? ? ? ? ? panel2.Dock = DockStyle.Fill;
? ? ? ? ? ? webBrowser1.Navigate("http://www.315soft.com");
? ? ? ? }

? ? ? ? private int[] RandArray()
? ? ? ? {
? ? ? ? ? ? int n = 20;
? ? ? ? ? ? int[] dataArray = new int[n];
? ? ? ? ? ? for (int i = 0; i < n; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? dataArray[i] = rnd.Next(20, 100);
? ? ? ? ? ? }
? ? ? ? ? ? return dataArray;
? ? ? ? }

? ? ? ? private void button6_Click(object sender, EventArgs e)
? ? ? ? {
? ? ? ? ? ? int[] arraySource = RandArray();
? ? ? ? ? ? int[] arrayTemplate = new int[arraySource.Length];
? ? ? ? ? ? MergeSort(0, arraySource.Length - 1, ref arraySource, ref arrayTemplate);

? ? ? ? ? ? loop = 0;
? ? ? ? ? ? timer1.Interval = 100;
? ? ? ? ? ? timer1.Enabled = true;
? ? ? ? }

? ? ? ? /// <summary>
? ? ? ? /// 歸并排序算法
? ? ? ? /// </summary>
? ? ? ? /// <param name="left"></param>
? ? ? ? /// <param name="right"></param>
? ? ? ? /// <param name="arraySource"></param>
? ? ? ? /// <param name="arrayTemplate"></param>
? ? ? ? private void MergeSort(int left, int right, ref int[] arraySource, ref int[] arrayTemplate)
? ? ? ? {
? ? ? ? ? ? if (left >= right)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? return;
? ? ? ? ? ? }
? ? ? ? ? ? int mid = (left + right) >> 1;
? ? ? ? ? ? MergeSort(left, mid, ref arraySource, ref arrayTemplate);
? ? ? ? ? ? MergeSort(mid + 1, right, ref arraySource, ref arrayTemplate);
? ? ? ? ? ? int head_left = left;
? ? ? ? ? ? int head_right = mid + 1;
? ? ? ? ? ? int tmp_index = left;
? ? ? ? ? ? while (head_left <= mid && head_right <= right)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (arraySource[head_left] < arraySource[head_right])
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? arrayTemplate[tmp_index++] = arraySource[head_left++];
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? arrayTemplate[tmp_index++] = arraySource[head_right++];
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? while (head_left <= mid)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? arrayTemplate[tmp_index++] = arraySource[head_left++];
? ? ? ? ? ? }
? ? ? ? ? ? while (head_right <= right)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? arrayTemplate[tmp_index++] = arraySource[head_right++];
? ? ? ? ? ? }
? ? ? ? ? ? for (int i = left; i <= right; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? arraySource[i] = arrayTemplate[i];
? ? ? ? ? ? }

? ? ? ? ? ? slides.Add(Slide(button6.Text, arraySource, left, right));
? ? ? ? }

? ? ? ? private string Slide(string title, int[] dataArray, int a, int b)
? ? ? ? {
? ? ? ? ? ? StringBuilder sb = new StringBuilder();
? ? ? ? ? ? sb.AppendLine("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
? ? ? ? ? ? sb.AppendLine("<html xmlns=\"http://www.w3.org/1999/xhtml\" >");
? ? ? ? ? ? sb.AppendLine("<head>");
? ? ? ? ? ? sb.AppendLine("<style>");
? ? ? ? ? ? sb.AppendLine("td { vertical-align:bottom;text-align:center;font-size:12px; } ");
? ? ? ? ? ? sb.AppendLine(".bar { width:" + (int)((webBrowser1.Width - dataArray.Length * 11) / dataArray.Length) + "px;font-size:12px;border:solid 1px #FF6701;background-color:#F08080;text-align:center;border-radius:3px; }");
? ? ? ? ? ? sb.AppendLine("</style>");
? ? ? ? ? ? sb.AppendLine("</head>");
? ? ? ? ? ? sb.AppendLine("<body>");
? ? ? ? ? ? sb.AppendLine("<table width='100%' style='border-bottom:solid 1px #E9E9E0;'>");
? ? ? ? ? ? sb.AppendLine("<tr>");
? ? ? ? ? ? sb.AppendLine("<td>方法:" + title + "</td>");
? ? ? ? ? ? sb.AppendLine("<td>數(shù)據(jù):" + dataArray.Length + "</td>");
? ? ? ? ? ? sb.AppendLine("<td>步驟:[0]</td>");
? ? ? ? ? ? sb.AppendLine("</tr>");
? ? ? ? ? ? sb.AppendLine("</table>");
? ? ? ? ? ? sb.AppendLine("<br>");
? ? ? ? ? ? sb.AppendLine("<table width='100%' style='border-bottom:solid 15px #E9E9E0;'>");
? ? ? ? ? ? sb.AppendLine("<tr>");
? ? ? ? ? ? for (int i = 0; i < dataArray.Length; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (i == a || i == b)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? sb.AppendLine("<td>" + dataArray[i] + "<div class='bar' style='height:" + dataArray[i] * 3 + "px;background-color:#993333;'></div></td>");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? sb.AppendLine("<td>" + dataArray[i] + "<div class='bar' style='height:" + dataArray[i] * 3 + "px;'></div></td>");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }

? ? ? ? ? ? sb.AppendLine("</tr>");
? ? ? ? ? ? sb.AppendLine("</table>");
? ? ? ? ? ? sb.AppendLine("</body>");
? ? ? ? ? ? sb.AppendLine("</html>");
? ? ? ? ? ? return sb.ToString();
? ? ? ? }


? ? ? ? int loop = 0;

? ? ? ? private void timer1_Tick(object sender, EventArgs e)
? ? ? ? {
? ? ? ? ? ? if (loop < slides.Count + (3000 / timer1.Interval))
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (loop < slides.Count)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? webBrowser1.DocumentText = slides[loop].Replace("[0]", loop + " / " + slides.Count);
? ? ? ? ? ? ? ? ? ? loop++;
? ? ? ? ? ? ? ? ? ? return;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? loop++;
? ? ? ? ? ? ? ? return;
? ? ? ? ? ? }
? ? ? ? ? ? loop = 0;
? ? ? ? }
? ? }
}
?

?——————————————————————

POWER BY 315SOFT.COM &
TRUFFER.CN

http://www.risenshineclean.com/news/64989.html

相關(guān)文章:

  • 莆田網(wǎng)站建設(shè)五維網(wǎng)絡(luò)有限公司百度ai助手入口
  • 網(wǎng)站后臺(tái)開發(fā) 必備技能關(guān)鍵詞林俊杰百度云
  • 彈幕網(wǎng)站制作市場(chǎng)營(yíng)銷策劃書
  • wordpress tag導(dǎo)入2022年seo最新優(yōu)化策略
  • vb2010做網(wǎng)站企業(yè)營(yíng)銷網(wǎng)站建設(shè)系統(tǒng)
  • html網(wǎng)站開發(fā)工具下載北京網(wǎng)站優(yōu)化托管
  • 東莞專業(yè)網(wǎng)站建設(shè)公司站長(zhǎng)工具ping
  • 河南做網(wǎng)站公司排名全國(guó)十大跨境電商公司排名
  • 在環(huán)評(píng)備案網(wǎng)站上做登記后會(huì)怎么樣6淘寶直通車
  • 做跨境的網(wǎng)站有哪些網(wǎng)絡(luò)口碑營(yíng)銷案例
  • 如何做國(guó)外的網(wǎng)站網(wǎng)絡(luò)營(yíng)銷八大工具
  • 直播營(yíng)銷惠州seo推廣優(yōu)化
  • 哪些網(wǎng)站做財(cái)金的好seo網(wǎng)絡(luò)營(yíng)銷技巧
  • 相城做網(wǎng)站的公司東營(yíng)網(wǎng)站建設(shè)費(fèi)用
  • 如何修改網(wǎng)站后臺(tái)seo推廣效果
  • 免費(fèi)空間申請(qǐng)網(wǎng)站google關(guān)鍵詞搜索技巧
  • 大連建站企業(yè)域名注冊(cè)需要什么條件
  • 做外貿(mào)的數(shù)據(jù)網(wǎng)站鏈接檢測(cè)工具
  • 學(xué)校網(wǎng)站織夢(mèng)源碼騰訊中國(guó)聯(lián)通
  • 315網(wǎng)站專題怎么做google推廣費(fèi)用
  • 平面設(shè)計(jì)師長(zhǎng)逛的網(wǎng)站有哪些網(wǎng)站的網(wǎng)絡(luò)推廣
  • 世界網(wǎng)站制作百度app怎么找人工客服
  • 網(wǎng)站開發(fā)付費(fèi)視頻才能觀看小程序開發(fā)公司排行榜
  • 網(wǎng)站首頁的尺寸2022網(wǎng)站seo
  • 網(wǎng)站開發(fā)職業(yè)規(guī)劃實(shí)施網(wǎng)站模板之家
  • 做營(yíng)銷網(wǎng)站設(shè)計(jì)百度免費(fèi)咨詢
  • 河北住房和城鄉(xiāng)建設(shè)局網(wǎng)站首頁百度免費(fèi)推廣
  • 東莞推廣網(wǎng)站排名seo研究中心官網(wǎng)
  • 教育行業(yè)網(wǎng)站建設(shè)代做seo關(guān)鍵詞排名
  • 正確的企業(yè)郵箱格式seo百度發(fā)包工具