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

表格网站怎么做关键词排名关键词优化

表格网站怎么做,关键词排名关键词优化,深圳网页设计公司建设,微信营销案例分析文章目录 数据结构和算法#xff0c;单链表的实现(kotlin版)b站视频链接1.定义接口#xff0c;我们需要实现的方法2.定义节点#xff0c;表示每个链表节点。3.push(e: E)#xff0c;链表尾部新增一个节点4.size(): Int#xff0c;返回链表的长度5.getValue(index: Int): E… 文章目录 数据结构和算法单链表的实现(kotlin版)b站视频链接1.定义接口我们需要实现的方法2.定义节点表示每个链表节点。3.push(e: E)链表尾部新增一个节点4.size(): Int返回链表的长度5.getValue(index: Int): E?获取列表的value值6.insert(index: Int,e: E)从任意位置插入一个节点7.remove(index: Int)任意位置删除一个节点8.完整Demo 数据结构和算法单链表的实现(kotlin版) b站视频链接 单链表的实现–koltin版本 1.定义接口我们需要实现的方法 interface LinkedListActionE {fun push(e: E)fun size(): Intfun getValue(index: Int): E?fun insert(index: Int,e: E)fun remove(index: Int) }2.定义节点表示每个链表节点。 data class NodeE(var next: NodeE? null, var value: E)3.push(e: E)链表尾部新增一个节点 override fun push(e: E) {val newNode Node(null, e)if (head ! null) { // val lastNode node(len - 1)//O1时间复杂度last?.next newNode} else {head newNode}last newNodelen}4.size(): Int返回链表的长度 override fun size(): Int {return len}5.getValue(index: Int): E?获取列表的value值 override fun getValue(index: Int): E? {if (index 0 || index len) {throw ArrayIndexOutOfBoundsException(数组越界.....)}return node(index)?.value}//找到对应index下标的节点。private fun node(index: Int): NodeE? {var h head//On时间复杂度for (i in 0 until index) {h h?.next}return h}6.insert(index: Int,e: E)从任意位置插入一个节点 override fun insert(index: Int, e: E) {val newNode Node(null, e)//考虑边界if (index 0) {val h headhead newNodenewNode.next h} else {//考虑最后一个位置val prev node(index - 1)val next prev?.nextprev?.next newNodenewNode.next next}len}//找到对应index下标的节点。private fun node(index: Int): NodeE? {var h head//On时间复杂度for (i in 0 until index) {h h?.next}return h}7.remove(index: Int)任意位置删除一个节点 override fun remove(index: Int) {if (index 0 || index len) {throw ArrayIndexOutOfBoundsException(数组越界.....)}if (index 0) {val h headhead h?.nexth?.next null} else {val prev node(index - 1)val current prev?.nextprev?.next current?.nextcurrent?.next null}len--}//找到对应index下标的节点。private fun node(index: Int): NodeE? {var h head//On时间复杂度for (i in 0 until index) {h h?.next}return h}8.完整Demo package day1class LinkedListE : LinkedListActionE {//头指针private var head: NodeE? null//优化时间复杂度private var last: NodeE? null//集合的长度private var len 0override fun push(e: E) {val newNode Node(null, e)if (head ! null) { // val lastNode node(len - 1)//O1时间复杂度last?.next newNode} else {head newNode}last newNodelen}//找到对应index下标的节点。private fun node(index: Int): NodeE? {var h head//On时间复杂度for (i in 0 until index) {h h?.next}return h}override fun size(): Int {return len}override fun getValue(index: Int): E? {if (index 0 || index len) {throw ArrayIndexOutOfBoundsException(数组越界.....)}return node(index)?.value}override fun insert(index: Int, e: E) {val newNode Node(null, e)//考虑边界if (index 0) {val h headhead newNodenewNode.next h} else {//考虑最后一个位置val prev node(index - 1)val next prev?.nextprev?.next newNodenewNode.next next}len}override fun remove(index: Int) {if (index 0 || index len) {throw ArrayIndexOutOfBoundsException(数组越界.....)}if (index 0) {val h headhead h?.nexth?.next null} else {val prev node(index - 1)val current prev?.nextprev?.next current?.nextcurrent?.next null}len--}}
http://www.dnsts.com.cn/news/212768.html

相关文章:

  • 小程序开发网站wordpress 到顶插件
  • 在凡科网申请的网站设置网页访问密码公司网站设计图
  • html语言做的网站和asp的区别织梦网站系统
  • 城市门户网站怎样盈利谷歌代运营
  • 图书网站开发数据库的建立招代理的网站要怎么做
  • 成都网站制作培训网站设计英语
  • 重庆做网站熊掌号网站如何动态修改主页
  • 兼职做商务标哪个网站品牌宣传策划方案
  • 做好网站维护管理集团企业网工管理系统
  • 济南济阳网站建设wordpress theme
  • 官方网站下载微博电子外发加工网
  • 找券网站怎么做厦门外贸网站seo
  • 北京网站建设公司册开网站做网站
  • 好的摄影网站推荐网站建设管理专业介绍
  • 合肥专业做淘宝网站推广上海公司注册一站式企业服务
  • 静态网站生成器怎样做2019做地方门户网站
  • 做防水怎么注册网站长春网络有限公司
  • 做市场分析的网站艺点意创官网
  • 如何做别人网站镜像郑州建材网站建设
  • 天津建设网投标网站做王境泽gif的网站
  • 企业网站怎么做建设工程施工合同解释一
  • 河南省监理建设协会网站内网 wordpress慢
  • 怎么自学网站建设最新发布地址跳转
  • 做网站流程视频WordPress织梦哪个快
  • 欧洲手表网站泰兴做网站
  • 威海高区建设局官方网站湖南企业建网站
  • 台州建设网站制作久久建筑网账号
  • wordpress建站中英文遵义网站开发的公司
  • 常用网站开发技术和工具先做网页设计还是先弄网站
  • 网站建设公司广天津百度推广排名