当前位置: 首页 > news >正文

中国网站访问量排行网站内容注意事项

中国网站访问量排行,网站内容注意事项,wordpress ftp服务器,网页设计与制作 pdf1 泛洪填充算法(Flood Fill Algorithm) 泛洪填充算法(Flood Fill Algorithm) ,又称洪水填充算法,是在很多图形绘制软件中常用的填充算法,最熟悉不过就是 windows 自带画图软件的油漆桶功能。 2 源程序 using System; using System.Collecti…

1 泛洪填充算法(Flood Fill Algorithm)

泛洪填充算法(Flood Fill Algorithm) ,又称洪水填充算法,是在很多图形绘制软件中常用的填充算法,最熟悉不过就是 windows 自带画图软件的油漆桶功能。

2 源程序

using System;
using System.Collections;
using System.Collections.Generic;

namespace Legalsoft.Truffer.Algorithm
{
    /// <summary>
    /// 洪水填充算法
    /// </summary>
    public static partial class Algorithm_Gallery
    {
        private static void Fill_4Directions(int[,] screen, int x, int y, int prevC, int newC)
        {
            int M = screen.GetLength(0);
            int N = screen.GetLength(1);

            if (x < 0 || x >= M || y < 0 || y >= N)
            {
                return;
            }
            if (screen[x, y] != prevC)
            {
                return;
            }
            screen[x, y] = newC;
            Fill_4Directions(screen, x + 1, y, prevC, newC);
            Fill_4Directions(screen, x - 1, y, prevC, newC);
            Fill_4Directions(screen, x, y + 1, prevC, newC);
            Fill_4Directions(screen, x, y - 1, prevC, newC);
        }

        public static void Flood_Fill(int[,] screen, int x, int y, int newC)
        {
            int prevC = screen[x, y];
            if (prevC == newC)
            {
                return;
            }
            Fill_4Directions(screen, x, y, prevC, newC);
        }
    }
}

3 代码格式

using System;
using System.Collections;
using System.Collections.Generic;namespace Legalsoft.Truffer.Algorithm
{/// <summary>/// 洪水填充算法/// </summary>public static partial class Algorithm_Gallery{private static void Fill_4Directions(int[,] screen, int x, int y, int prevC, int newC){int M = screen.GetLength(0);int N = screen.GetLength(1);if (x < 0 || x >= M || y < 0 || y >= N){return;}if (screen[x, y] != prevC){return;}screen[x, y] = newC;Fill_4Directions(screen, x + 1, y, prevC, newC);Fill_4Directions(screen, x - 1, y, prevC, newC);Fill_4Directions(screen, x, y + 1, prevC, newC);Fill_4Directions(screen, x, y - 1, prevC, newC);}public static void Flood_Fill(int[,] screen, int x, int y, int newC){int prevC = screen[x, y];if (prevC == newC){return;}Fill_4Directions(screen, x, y, prevC, newC);}}
}

http://www.yayakq.cn/news/852773/

相关文章:

  • 中国建设银行国际互联网网站自己开发微网站
  • 网站内外链怎么做做淘宝客如何引出图片到网站
  • 网站建设课程体会某集团中英文双语网站源码
  • 高端视觉网站体育彩票网站开发该做哪些步骤
  • 容桂网站制作信息最好看中文字幕国语电影
  • 做网站用python好还是PHP好免费免费建网站
  • 站长之家素材网站适合推广的app有哪些
  • wordpress建站时间贵阳查房子备案的网站
  • 多多卡起货网站建设网站平台建设投资费用清单
  • 简洁物流网站模板重庆建筑安全信息网
  • 怎么进入网站管理页面百度开发者平台
  • 济南网站seo 优帮云利润很吓人10个冷门创业
  • 网站开发iosps怎么艺术字字体设计网站
  • app网站开发长沙百度新闻源网站
  • 企业网站建设的要素有哪些网络推广的优势
  • 做公众号微网站建筑培训网能发焊工证吗
  • 网站开发语言查看器免费建立网站软件
  • wordpress微信分享图片正版seo搜索引擎
  • 阿凡达网站建设网电子商务网站建设的评估
  • 如何更改网站标签logo网络营销就业前景和薪水
  • 海南省建设设厅官方网站wordpress关闭邮件验证
  • 互助盘网站怎么做的柳州做网站优化
  • 长春网络公司做网站利津网站制作
  • 各种网站名称大全南宁网站建设专业品牌
  • 网站建设分期进行怎么入账百度贴吧官网网页
  • 网站模仿三网合一网站方案
  • 路由器做映射后 内网可以访问到我的网站 但是外网无法访问wordpress初级教程老左
  • 企业手机端网站设计模板wordpress遍历菜单
  • 网站首页的动态怎么做asp.net 4.0网站建设基础教程 下载
  • 网站建设电话销售工作总结网站推广一站式服务