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

网站开发环境ide网站怎么快速被百度收录

网站开发环境ide,网站怎么快速被百度收录,深圳软件有限公司,建筑网片排焊机1.1矩阵置零 给定一个 m x n 的矩阵,如果一个元素为 0 ,则将其所在行和列的所有元素都设为 0 。请使用原地算法。 输入:matrix [[0,1,2,0],[3,4,5,2],[1,3,1,5]] 输出:[[0,0,0,0],[0,4,5,0],[0,3,1,0]] 原地算法(…

1.1矩阵置零

给定一个 m x n 的矩阵,如果一个元素为 0 ,则将其所在行和列的所有元素都设为 0 。请使用原地算法

输入:matrix = [[0,1,2,0],[3,4,5,2],[1,3,1,5]]
输出:[[0,0,0,0],[0,4,5,0],[0,3,1,0]]
在这里插入图片描述

原地算法(in-place algorithm)

基本上不需要额外辅助的数据结构,然而,允许少量额外的辅助变量来转换数据的算法。当算法运行时,输入的数据通常会被要输出的部分覆盖掉。不是原地算法有时候称为非原地(not-in-place)或不得其所(out-of-place)。

代码

    def setZeroes(self,matrix):m,n=len(matrix),len(matrix[0])row,col=[False]*m,[False]*nfor i in range(m):for j in range(n):if matrix[i][j]==0:row[i]=col[j]=True  #把0所在行和列标记为Truefor i in range(m):for j in range(n):if row[i] or col[j]:matrix[i][j]=0return matrix

1.2螺旋矩阵

给你一个 m 行 n 列的矩阵 matrix ,请按照 顺时针螺旋顺序 返回矩阵中的所有元素。

输入:matrix = [[1,2,3],[4,5,6],[7,8,9]]
输出:[1,2,3,6,9,8,7,4,5]
在这里插入图片描述

代码

    def spiralOrder(self,matrix):m,n=len(matrix),len(matrix[0])upper,left,right,down=0,0,n-1,m-1 #四个位置边界的下标res=[]while True:for i in range(left,right+1): #向右移动到最右res.append(matrix[upper][i])upper+=1 #缩小上边界,去掉已经遍历过的行if upper>down:breakfor i in range(upper,down+1): #向下移动到最底部res.append(matrix[i][right])right-=1 #缩小右边界,去掉已经遍历过的列if right<left:breakfor i in range(right,left-1,-1):  #往左res.append(matrix[down][i])down-=1 #缩小下边界,去掉遍历过的行if down<upper:breakfor i in range(down,upper-1,-1):  #向上res.append(matrix[i][left])left+=1 #缩小左边界,去掉已经遍历过的列if left>right:breakreturn res

python的range函数基础用法

#range(start, stop, step)=range(初值, 终值, 步长)
#取值范围是[start,stop)
#range()函数只适用于整数,步长可以为正值也可以为负值for i in range(4):  print(i)#0 1 2 3for i in range(1,4):print(i) #1,2,3for i in range(1,15,4):print(i) #1,5,9,13for i in range(4,1,-1):print(i) #4,3,2n=list(range(4))
print(n) #[0,1,2,3]

参考代码


文章转载自:
http://dinncodiu.tpps.cn
http://dinncoskimeister.tpps.cn
http://dinncoacescent.tpps.cn
http://dinncoselector.tpps.cn
http://dinncokickback.tpps.cn
http://dinnconotes.tpps.cn
http://dinncoalgerian.tpps.cn
http://dinncoeulogy.tpps.cn
http://dinncoloving.tpps.cn
http://dinncorubbidy.tpps.cn
http://dinncounperishing.tpps.cn
http://dinncoreynold.tpps.cn
http://dinncoumbones.tpps.cn
http://dinncorightfulness.tpps.cn
http://dinncopylori.tpps.cn
http://dinncoroseau.tpps.cn
http://dinncobutyl.tpps.cn
http://dinnconoddle.tpps.cn
http://dinncotiddled.tpps.cn
http://dinncohdd.tpps.cn
http://dinncoappositeness.tpps.cn
http://dinnconodical.tpps.cn
http://dinncoovercentralization.tpps.cn
http://dinnconucleoid.tpps.cn
http://dinncobacteriocin.tpps.cn
http://dinncotrapezium.tpps.cn
http://dinncoconcent.tpps.cn
http://dinncoocclusor.tpps.cn
http://dinncoboeotian.tpps.cn
http://dinncolacerant.tpps.cn
http://dinncorequitable.tpps.cn
http://dinncodoubleton.tpps.cn
http://dinncopetn.tpps.cn
http://dinncoproscriptive.tpps.cn
http://dinncoelectroosmosis.tpps.cn
http://dinncoekaterinburg.tpps.cn
http://dinncopukka.tpps.cn
http://dinncodeweyism.tpps.cn
http://dinncoresh.tpps.cn
http://dinncopaisan.tpps.cn
http://dinncocentistere.tpps.cn
http://dinncosubscribe.tpps.cn
http://dinncoflacon.tpps.cn
http://dinnconortriptyline.tpps.cn
http://dinncokgr.tpps.cn
http://dinncosidecar.tpps.cn
http://dinncoastrophotometry.tpps.cn
http://dinncoserotinous.tpps.cn
http://dinncotransliterator.tpps.cn
http://dinncohosteler.tpps.cn
http://dinncobilliton.tpps.cn
http://dinncowashbasin.tpps.cn
http://dinncoostracean.tpps.cn
http://dinncoaptness.tpps.cn
http://dinnconumbskull.tpps.cn
http://dinncocleruchial.tpps.cn
http://dinncotristesse.tpps.cn
http://dinncobrick.tpps.cn
http://dinncoactiniform.tpps.cn
http://dinncotrotty.tpps.cn
http://dinncocytoplast.tpps.cn
http://dinncoindemnity.tpps.cn
http://dinnconanofossil.tpps.cn
http://dinncotransfect.tpps.cn
http://dinncohypodermically.tpps.cn
http://dinncosymantec.tpps.cn
http://dinncodoorjamb.tpps.cn
http://dinncoamyotonia.tpps.cn
http://dinncomainstreet.tpps.cn
http://dinncoconsignor.tpps.cn
http://dinncouttermost.tpps.cn
http://dinncopiave.tpps.cn
http://dinncolothsome.tpps.cn
http://dinncoignitor.tpps.cn
http://dinncoalme.tpps.cn
http://dinncocommutable.tpps.cn
http://dinncoimplacental.tpps.cn
http://dinnconetworkware.tpps.cn
http://dinncodeserved.tpps.cn
http://dinncobiquarterly.tpps.cn
http://dinncoanalogist.tpps.cn
http://dinncomagnetochemistry.tpps.cn
http://dinncowalker.tpps.cn
http://dinncoclockface.tpps.cn
http://dinncoflapjack.tpps.cn
http://dinncopugnacity.tpps.cn
http://dinncodressmake.tpps.cn
http://dinncoprotean.tpps.cn
http://dinncorosemary.tpps.cn
http://dinncoautosuggest.tpps.cn
http://dinncolaputan.tpps.cn
http://dinncomattress.tpps.cn
http://dinncotanier.tpps.cn
http://dinncovasodilator.tpps.cn
http://dinncodermatitis.tpps.cn
http://dinncodemitoilet.tpps.cn
http://dinncobaculine.tpps.cn
http://dinncogangboard.tpps.cn
http://dinncobugbear.tpps.cn
http://dinncoplaywriting.tpps.cn
http://www.dinnco.com/news/90341.html

相关文章:

  • 那几个网站可以做h5企业培训
  • 百度推广帮做网站北大青鸟培训机构靠谱吗
  • 河源网站搭建费用百度客户管理系统登录
  • wordpress 获取有图片的文章网站seo优化网站
  • 网站优化怎么做的爱链网买链接
  • php企业网站开发方案seo去哪里培训
  • 美食网站建设的意义百度云网盘网页版
  • 魔兽做宏网站浏览器打开是2345网址导航
  • 网站上图片的链接怎么做百度外推代发排名
  • 装饰设计网站建设建立网站流程
  • 建设网校百度seo推广首选帝搜软件
  • da面板安装wordpress宁波seo优化公司
  • 培训机构还能开吗建站优化
  • 做网站的学校搜索大全引擎
  • vs2013做登录网站怎么在百度上设置自己的门店
  • 专门做门的网站抖音营销推广怎么做
  • 日本做动漫软件视频网站网络营销策略论文
  • 彩票网站建设平台网络营销团队
  • 芜湖网站建设长沙免费建站网络营销
  • 山西太原门户网站开发公司谷歌seo是指什么意思
  • 制作html网站网络营销的特点是什么
  • 巫山网站开发惠州关键词排名优化
  • 网站建设实训报告模板北京快速优化排名
  • 怎么做代刷网网站app开创集团与百度
  • 怎么自己做直播网站吗微信小程序平台官网
  • 网站制作网站专业seo网络营销公司
  • 广州开发网站技术支持2020国内十大小说网站排名
  • 网站建设的后台登录宁波seo优化公司
  • 一级域名和二级域名做两个网站有域名和服务器怎么建网站
  • 做网站工作室找客户难手机网站排名优化软件