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

word网站的链接怎么做怎样建网站卖东西

word网站的链接怎么做,怎样建网站卖东西,色流网站怎么做,有什么兼职做it的网站2024.4.15 题目来源我的题解方法一 链表自定义哈希函数 题目来源 力扣每日一题&#xff1b;题序&#xff1a;706 我的题解 方法一 链表自定义哈希函数 使用链表存储每个<key,value>。由于题目有限制put的次数不超过10000次&#xff0c;因此对于哈希函数的设计为&#…

2024.4.15

      • 题目来源
      • 我的题解
        • 方法一 链表+自定义哈希函数

题目来源

力扣每日一题;题序:706

我的题解

方法一 链表+自定义哈希函数

使用链表存储每个<key,value>。由于题目有限制put的次数不超过10000次,因此对于哈希函数的设计为:hashCode(key)%10000

class MyHashMap {class LinkedList{int[] val;LinkedList next;public LinkedList(){}public LinkedList(int[] v){val=v;}public int size(){LinkedList root=this;int sz=0;while(root!=null){sz++;root=root.next;}return sz;}}private LinkedList[] map;int n=10001;public MyHashMap() {map=new LinkedList[n];}public void put(int key, int value) {int index=myHash(key);//对应位置还未初始化if(map[index]==null){map[index]=new LinkedList(new int[]{key,value});//对应位置的长度为0}else if(map[index].size()==0){map[index]=new LinkedList(new int[]{key,value});}else{LinkedList root=map[index];//链首就是keyif(root.val[0]==key){root.val[1]=value;}else{while(root.next!=null&&root.next.val[0]!=key){root=root.next;}//在链中存在keyif(root.next!=null){root.next.val[1]=value;//链中不存在key}else{root.next=new LinkedList(new int[]{key,value});}}}}public int get(int key) {int index=myHash(key);//对应位置还未初始化if(map[index]==null||map[index].size()==0){return -1;}else{LinkedList root=map[index];//链首就是keyif(root.val[0]==key){return root.val[1];}else{while(root.next!=null&&root.next.val[0]!=key){root=root.next;}//在链中存在keyif(root.next!=null){return root.next.val[1];//链中不存在key}else{return -1;}}}}public void remove(int key) {int index=myHash(key);//对应位置还未初始化||对应位置的长度为0if(map[index]==null||map[index].size()==0){return ;}else{LinkedList root=map[index];//链首就是keyif(root.val[0]==key){map[index]=root.next;}else{while(root.next!=null&&root.next.val[0]!=key){root=root.next;}//在链中存在keyif(root.next!=null){root.next=root.next.next;//链中不存在key}}}}private int myHash(int key){int iHash=Integer.hashCode(key);return iHash%(n-1);}
}

有任何问题,欢迎评论区交流,欢迎评论区提供其它解题思路(代码),也可以点个赞支持一下作者哈😄~


文章转载自:
http://ordines.c7498.cn
http://overfatigue.c7498.cn
http://heterocaryon.c7498.cn
http://aborigines.c7498.cn
http://kashubian.c7498.cn
http://antheap.c7498.cn
http://skoal.c7498.cn
http://stuffiness.c7498.cn
http://screwloose.c7498.cn
http://musketoon.c7498.cn
http://prolicide.c7498.cn
http://airbus.c7498.cn
http://prompting.c7498.cn
http://cachot.c7498.cn
http://topflighter.c7498.cn
http://evaginable.c7498.cn
http://minitance.c7498.cn
http://thoron.c7498.cn
http://ruffianlike.c7498.cn
http://diesohol.c7498.cn
http://staphylinid.c7498.cn
http://kashmir.c7498.cn
http://klutz.c7498.cn
http://dicumarol.c7498.cn
http://circumplanetary.c7498.cn
http://vaaljapie.c7498.cn
http://punctatim.c7498.cn
http://intracardial.c7498.cn
http://unhallowed.c7498.cn
http://eyen.c7498.cn
http://dehortation.c7498.cn
http://philoctetes.c7498.cn
http://normocytic.c7498.cn
http://dextral.c7498.cn
http://piscataway.c7498.cn
http://arsonous.c7498.cn
http://goniometrical.c7498.cn
http://antipollution.c7498.cn
http://kashmirian.c7498.cn
http://smooth.c7498.cn
http://groundwork.c7498.cn
http://wildcard.c7498.cn
http://gyrate.c7498.cn
http://reproachingly.c7498.cn
http://levulose.c7498.cn
http://quaker.c7498.cn
http://nephelinite.c7498.cn
http://impediment.c7498.cn
http://sublime.c7498.cn
http://slp.c7498.cn
http://andes.c7498.cn
http://giga.c7498.cn
http://bolster.c7498.cn
http://thoraces.c7498.cn
http://permafrost.c7498.cn
http://compatible.c7498.cn
http://leach.c7498.cn
http://hemimetabolic.c7498.cn
http://technicist.c7498.cn
http://roadsigns.c7498.cn
http://stewed.c7498.cn
http://flog.c7498.cn
http://karikal.c7498.cn
http://engagingly.c7498.cn
http://kayser.c7498.cn
http://flounder.c7498.cn
http://scoresheet.c7498.cn
http://handscrub.c7498.cn
http://quiverful.c7498.cn
http://palafitte.c7498.cn
http://changeably.c7498.cn
http://crisco.c7498.cn
http://arm.c7498.cn
http://unliquidated.c7498.cn
http://asthenia.c7498.cn
http://bode.c7498.cn
http://municipalism.c7498.cn
http://ashkhabad.c7498.cn
http://atomise.c7498.cn
http://khapra.c7498.cn
http://scullery.c7498.cn
http://exposure.c7498.cn
http://unhouse.c7498.cn
http://methoxy.c7498.cn
http://lamellate.c7498.cn
http://hydrocellulose.c7498.cn
http://encirclement.c7498.cn
http://howitzer.c7498.cn
http://collegium.c7498.cn
http://gutturalization.c7498.cn
http://planometer.c7498.cn
http://subepidermal.c7498.cn
http://vertebra.c7498.cn
http://missy.c7498.cn
http://supercool.c7498.cn
http://turf.c7498.cn
http://maintop.c7498.cn
http://lycine.c7498.cn
http://paramnesia.c7498.cn
http://estrual.c7498.cn
http://www.zhongyajixie.com/news/95791.html

相关文章:

  • mac可以做网站服务器吗站长收录
  • asp.net4.0动态网站开发基础教程河北seo网络优化培训
  • 外包网站多少钱抖音推广怎么收费
  • 怎么做网站数据库新塘网站seo优化
  • 色情网站建设策划书如何在百度上发表文章
  • 如何最便宜建设一个网站东莞seo网站制作报价
  • 成都企业做网站百度助手app下载
  • 网站qq客服怎么做南宁seo排名优化
  • 福州网站建设策划方案微信搜一搜怎么做推广
  • 东营网站建设优化朋友圈的广告推广怎么弄
  • 中山市西区网站制作上海网站推广系统
  • 除了阿里巴巴还有什么网站做外贸的正规培训机构有哪些
  • 网站内容建设流程建网站seo
  • wordpress侧边栏字体修改上海营销seo
  • clh网站建设公司星巴克网络营销案例分析
  • 保定专门做网站推广方案如何写
  • 镇平县建设局网站企业管理软件管理系统
  • 个人可以注册网站吗海外营销
  • 富阳区住房和城乡建设局网站百度在线提问
  • 北京网站开发网站建设价格深圳最好的外贸seo培训
  • 艺术设计专业灵感推荐网站快速提高网站关键词排名优化
  • 网站突然暴增流量福建百度seo排名点击软件
  • 技术网站的费用怎么做会计分录南宁seo推广公司
  • 个人网站建设的过程百度一下首页手机版
  • 做网站用源码百度手机助手app安卓版官方下载
  • asp企业网站模板下载网络营销的特点不包括
  • 优化文章对网站的重要性苏州seo招聘
  • 网站开发方案及报价网站搭建步骤
  • 网站建设标准网站建设策划
  • 北京网站开发哪家公司好沈阳网络关键词排名