• 2024-07-23XGBoost、RF随机森林算法MATLAB实现
    %加载并预处理训练数据opts1=detectImportOptions('附件一AE.xlsx','PreserveVariableNames',true);train_data=readtable('附件一AE.xlsx',opts1);train_data.Time=datetime(train_data.time,'InputFormat','yyyy-MM-ddHH:mm:s
  • 2024-03-27java实现crc校验
    publicintcheckCrc(byte[]inBuf,intstartIdx,intendIdx){try{intwCRCin=0x0000;intwCPoly=0xA001;for(inti=startIdx;i<endIdx;i++){wCRCin^=((int)inBuf[i]&0x00ff
  • 2024-03-17Leecode 搜索插入位置
    Day2刷题我的思路:利用二分法解决问题,不过由于情况没有好好分类,以及循环判定条件不合适,会出现超出运行时间的bug。classSolution{publicintsearchInsert(int[]nums,inttarget){intlength=nums.length;intStartIdx=0;intFinal
  • 2023-04-07模拟循环批量请求后台接口
    使用async,await处理异步请求。用Promise,setTimeout函数模拟后台接口<!DOCTYPEhtml><html><scripttype="text/javascript">vararr=[];varbatchSize=10;for(i=0;i<30;i++){arr.push(i);}functionb(startIdx,endIdx){ returnnewPromise((res
  • 2023-02-05数组中找到与目标值最接近的数字
    //二分法O(logn)constfindNearestTarget=(nums=[1,2,6,9,10],target=3)=>{letstartIdx=0,endIdx=nums.length-1;while(star
  • 2023-02-01最长连续序列
    constlongestConsecutive=(nums=[0,1,2,4,8,5,6,7,9,3,55,88,77,99,999999999])=>{constlength=nums.lengthif(length===0||length===1)retur
  • 2022-12-05LeetCode: 228. Summary Ranges
    LeetCode:228.SummaryRanges题目描述Givenasortedintegerarraywithoutduplicates,returnthesummaryofitsranges.Example1:Input:[0,1,2,4,5,7]Output:[