网站首页 站内搜索

搜索结果

查询Tags标签: list,共有 4243条记录
  • 7_列表、元组和字符串相互转换

    # list(),tuple(),str()# 字符串变成列表(list) print(list("Loveyou")) # [L, o, v, e, y, o, u] # 元组变成列表(list) print(list((1, 2, 3, 4, 5))) # [1, 2, 3, 4, 5]# 将一个可迭代对象转换成元组tuple() print(tuple("Loveyou")) # (L, o,…

    2022/8/5 6:24:01 人评论 次浏览
  • Java SE - 集合

    Java 的集合体系Java集合可分为两大体系:Collection 和 Map 1.常见的Java集合如下: Collection接口:单列数据,定义了存取一组对象的方法的集合List:元素有序(指的是存取时,与存放顺序保持一致)、可重复的集合 Set:元素无序、不可重复的集合Map接口:双列数据,保存…

    2022/8/5 1:23:59 人评论 次浏览
  • java 将两个List对象合并并去重

    import java.time.format.DateTimeFormatter; import java.util.Collection; import java.util.stream.Collectors; import java.util.stream.Stream;List<OrderAppointmentSales> orderAppointmentSales = obcOrderAppointmentSalesService.getOrderAppointmentSal…

    2022/8/5 1:22:56 人评论 次浏览
  • [Algorithm] Doubly Linked list construction

    // This is an input class. Do not edit. class Node {constructor(value) {this.value = value;this.prev = null;this.next = null;} }// Feel free to add new properties and methods to the class. class DoublyLinkedList {constructor() {this.head = null;this.t…

    2022/8/4 6:22:57 人评论 次浏览
  • 字符串数组、字符串集合相互转换

    //字符串数组-->字符串集合 String[] strArr = {"AA","BB","CC"}; List<String> list = Arrays.asList(strArr);//字符串集合-->字符串数组 List<String> list = new ArrayList<>(); list.add("AA"); li…

    2022/8/3 6:23:55 人评论 次浏览
  • 使用python爬虫爬取新冠疫情数据并进行可视化展示

    新冠疫情爆发对全国造成重大影响,各行各业因为疫情皆受到不小的波及。如何编写一个python程序爬取疫情数据,实现新冠疫情数据可视化并以大屏形式展现到屏幕供人们观看与使用, 下面我将一步步介绍该程序实现流程.下载程序所需要的库pip install xxxx (xxxx为所需库的名…

    2022/8/2 14:52:59 人评论 次浏览
  • 泛型编程与增强for循环

    泛型:只在程序编译阶段起作用,给编译器参考的,泛型的优点就是统一了集合中的元素类型,取出元素时不太需要大量地向下转型。但是也会导致集合中的元素缺乏多样性! package com.javastudy.example09;import javax.swing.text.html.HTMLDocument; import java.util.Arra…

    2022/8/2 14:52:56 人评论 次浏览
  • PAT (Advanced Level) Practice 1006 Sign In and Sign Out 分数 25 Python 解法

    题目 At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing ins and outs, you are supposed to find the ones who have unlocked…

    2022/8/2 14:23:55 人评论 次浏览
  • php数组通过递归转换成无限级树结构

    //id作为索引,pid 为父索引function tree(&$list,$pid=0){$tree=[];foreach ($list as $key=>$item){if ($item[pid]===$pid){$tree[$item[id]]=$item;unset($list[key]); //删除当前项,减小递归压力$tree[$item[id]][children]=tree($list,$item[id]); //使用ch…

    2022/8/2 14:22:45 人评论 次浏览
  • 16.Python爬虫:抓取多级页面数据

    前面讲解的爬虫案例都是单级页面数据抓取,但有些时候,只抓取一个单级页面是无法完成数据提取的。本节讲解如何使用爬虫抓取多级页面的数据。在爬虫的过程中,多级页面抓取是经常遇见的。下面以抓取二级页面为例,对每级页面的作用进行说明:一级页面提供了获取二级页面的…

    2022/8/2 1:24:31 人评论 次浏览
  • PAT (Advanced Level) Practice 1008 Elevator 分数 20 Python 解法

    题目 The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 …

    2022/8/2 1:24:09 人评论 次浏览
  • PAT (Advanced Level) Practice 1009 Product of Polynomials 分数 25

    题目 This time, you are supposed to find AB where A and B are two polynomials.Input Specification: Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial:$ K N_1 a_N_1 N_2 a_N_2 ... N…

    2022/8/1 23:25:53 人评论 次浏览
  • 技术点总结

    //深拷贝对象/// <summary>/// 深拷贝对象:循环List是直接改变当前对象的值,所以如果需要改变值且不动到当前list需要深拷贝, 因为是引用类型最终都是指向一个内存地址/// </summary>/// <typeparam name="T"></typeparam>/// <pa…

    2022/8/1 23:24:17 人评论 次浏览
  • Leecode 3.无重复字符的最大字串长度(Java 暴力拆解)

    想法: 1.暴力解法,遇到重复字符就重新开辟空间,最后比较字串长度。 2.指针,但思路不太清晰----查看答案和思路,重新整理 滑动窗口:1.设left,right用于下标值,length,maxLength长度值,一个set,还有初始给的string s 2.将s转成字符类型的数组,得到数组长度 3. 当s…

    2022/8/1 1:22:47 人评论 次浏览
  • C++实现简单的线程池

    // thread_pool.h #pragma once #include <vector> #include <deque> #include <thread> #include <functional> #include <condition_variable>class ThreadPool {using Task = std::function<void()>;using TaskList = std::deque&…

    2022/7/30 14:22:53 人评论 次浏览
扫一扫关注最新编程教程