LinkedList公共对象peekFirst()方法 (LinkedList public Object peekFirst() method) This method is available in package java.util.LinkedList.peekFirst(). 软件包java.util.LinkedList.peekFirst()中提供了此方法。 This method is used to retrieve the first or initia…
LinkedList对象的pop()方法 (LinkedList Object pop() method) This method is available in package java.util.LinkedList.pop(). 软件包java.util.LinkedList.pop()中提供了此方法。 This method is used to delete or remove or return or pop an object at the top of the…
1.列表推导式总共有两种形式:
①[x for x in data if condition]
此处if主要起条件判断作用,data数据中只有满足if条件的才会被留下,最后统一生成为一个数据列表
②[exp1 if condition else exp2 for x in data]
此处if…else主要起赋值作…
python 示例字典get()方法 (Dictionary get() Method) get() method is used to get the value of an element based on the specified key. get()方法用于根据指定的键获取元素的值。 Syntax: 句法: dictionary_name.fromkeys(keys, value)Parameter(s): 参数&am…
python打印变量类型Declare different types of variables; print their types, ids and variables in Python. 声明不同类型的变量; 在Python中打印其类型,id和变量。 There are two inbuilt functions are using in the program: 程序中使用了两个内置…
stl 数组最大元素Given an array and we have to create a list, that should be assigned with all elements of the array using C (STL) program. 给定一个数组,我们必须创建一个列表,该列表应使用C (STL)程序分配给该数组的所有元素。 Example: 例&…
for <循环变量> in <遍历结构> :<语句块>计数遍历
#first.py
for i in range(5) : #range(N)表示生成0~N-1的序列,表示i从0遍历到N-1print(i) #0 1 2 3 4字符串遍历
for c in s : #s是字符串,遍历字符串的每个字符赋值到c<语句块…
python 示例Python关键字 (Python keywords) Keywords are the reserved words in any programming language and their meanings/tasks are predefined, we cannot change their meanings. 关键字是任何编程语言中的保留字,它们的含义/任务是预定义的,我…
一.列表推导式
使用[]生成list的基本格式为: variable [Out_exp_res for out_exp in input_list if out_exp 2] (1) out_exp_res:列表生成元素表达式,可以是有返回值的函数 (2)for out_exp in input_list:迭代input_list将out_…
对单个字符串排序Problem statement: 问题陈述: Given a singly linked list which is ordered in terms of absolute value. Return the sorted linked list in ascending order (based on their original values). No additional storage should be used. 给定一…
python中绝对值函数In the below program – we are creating a function named get_absolute_value(), it accepts a number and returns the absolute value of the given number. 在下面的程序中-我们正在创建一个名为get_absolute_value()的函数,该函数接受一个…
python数据科学速查表The printable version of this cheat sheet 该备忘单的可打印版本 The tough thing about learning data is remembering all the syntax. While at Dataquest we advocate getting used to consulting the Python documentation, sometimes it’s nice …
DOM 的增删改
内部插入:
appendTo() —格式 —> a.appendTo(b) 把 a 插入到 b 子元素末尾,成为最后一个子元素 prependTo() —格式 —> a.prependTo(b) 把 a 插到 b 所有子元素前面,成为第一个子元素
外部插入:
insertA…
前提:有两个列表,列表a和列表b,要求去除列表a中所有在列表b中的包含的元素
方法1,代码如下:
def array_diff(a, b):#定义空列表c[]#range(len(a))取的为列表a的索引,根据a的for i in range(len(a)):#取出…
python 示例列表sort()方法 (List sort() Method) sort() method is used to sort the list elements in the ascending and descending order, the method is called with this list (whose elements to be sorted) and accept some optional parameters (explained below und…
scala反转字符串反转字符串 (Reversing a string) Logically, reversing is swapping the values from index 1 with index n, index 2 with index n-1, and so on. 从逻辑上讲,反向是将索引1中的值与索引n交换,将索引2中的值与索引n-1交换,依…
字符串逗号分隔成字符串数组Given an array and we have to create a comma delimited string from the array without using library function. 给定一个数组,我们必须使用该数组创建一个逗号分隔的字符串,而无需使用库函数。 Example: 例:…
c stl eraseC STL set :: erase()函数 (C STL set::erase() function) set::erase() function is a predefined function, it is used to erase an element from a set. set :: erase()函数是预定义的函数,用于删除集合中的元素。 Prototype: 原型: s…
deque简介
deque 是一个双端列表, 如果要经常从两端操作数据, 选择deque 就比较好, 如果要实现随机访问,还是建议使用列表list. collections.deque官方说明文档
操作简介
append()
append(x) Add x to the right side of the deque.
import collections
mydequecollection…
flash 烟花模板Flask comes with a Jinja templating language. The template essentially contains variables as well as some programming logic, which when evaluated are rendered into HTML with actual values. The variables and/or logic are placed between tags or…
python列表当堆栈First of all, we must aware with the Stack - the stack is a linear data structure that works on LIFO mechanism i.e. Last In First Out (that means Last inserted item will be removed (popped) first). 首先,我们必须了解堆栈 - 堆栈是一…
c#孪生素数查找程序Problem statement: 问题陈述: You are given a number N, you have to find the largest list of prime numbers that will give N after summation of the list. 给您一个数字N ,您必须找到最大的质数列表,该列表加总后…
python日历模块Python calendar.calendar()方法 (Python calendar.calendar() Method) calendar() method is an inbuilt method of the calendar module in Python. It works on simple text calendars and returns a 3-column calendar for an entire year as a multi-line s…
css精灵Have you looked at the HTML markup of the new Yahoo homepage? Then you should. The markup (although it wont validate) is a piece of semantic art. Lists are lists, tabs are lists, only one table to be seen (obviously plugged-in coming from a differe…
pandas写入excelIn this tutorial we will learn how to work with Excel files and Python. It will provide an overview of how to use Pandas to load and write these spreadsheets to Excel. In the first section, we will go through, with examples, how to read an E…
一、赋值 在python中,对象的赋值就是简单的引用,a [1,2,3], ba, 在上述情况下,a和b是一样的,他们指向同一片内存,b不过是a的别名,是引用,我们可以使用b is a 去判断,返回True,表名他们地址相同内容也相同,也可以使用id()函数来查看.看两个列表地址是否相同. 赋值操作(包括对象…
4.1 遍历整个列表
>>> for magician in magicians:
... print(magician)
...
alice
david
carolina4.1.1 深入地研究循环
首先,程序执行第一行代码,获取列表magcians中的第一个值,将其存储到变量magician中。
for magician in…
python熊猫图案Pandas is arguably the most important Python package for data science. Not only does it give you lots of methods and functions that make working with data easier, but it has been optimized for speed which gives you a significant advantage com…
单向链表 反转链表Problem statement: Given a linked list reverse it without using any additional space (In O(1) space complexity). 问题陈述:给定的链表在不使用任何额外空间的情况下将其反向(O(1)空间复杂度)。 Solution: 解: Reversing a si…
环境:Windows Server 2012,SharePoint 2013,Visual Studio 2013 1、进入列表设置,找到【版本控制设置】
2、提交的项目是否需要内容审批,选择【是】,保存就开启了列表的版本控制
3、在列表内容界面&a…
1.求多个list的交集
输入:
"""以a、b、c为实验对象,求a、b、c都同时拥有的元素"""
a [0,1,2,3,4]
b [0,2,6]
c [-1,2,5,8]# 求多个list的交集:a、b、c同时拥有的元素
r list(set(a).intersection(b,c)) …
#顺序表的插入
def insert_list(L,i,data): #在顺序表L的第i个位置处插入新元素datalengthlen(L) if i <1 or i>length:return Falseelse:for j in range(i-1,length)[::-1]: #逆序输出从length-1到i-1的元素L[j1:j2][L[j]] #被插入位置索引之后的元素后移L[i-1]dataretu…
css命令(In Russian) (俄语) OK, CSS sprite tools exist. Im pretty confident I actually made the very first one 🙂 But they break from time to time (like mine currently). And then the command line is cool (as opposed to scary) and oh-so-quick. And…
python 数据框反转In this post we will learn how to reverse pandas dataframe. We start by changing the first column with the last column and continue with reversing the order completely. After we have learned how to do that we continue by reversing the orde…
Given a list of the integer numbers and we have to print all perfect numbers present in the given list. 给定一个整数列表,我们必须打印给定列表中存在的所有正整数。 This Program iterating through each number one by one in the list, and check wheth…
python 深复制对象Assignment statements in Python do not create copies of objects, they only bind names to an object. For immutable objects, that usually doesn’t make a difference. Python中的赋值语句不会创建对象的副本,它们只会将名称绑定到对象。 …
stl:queue 源码In C STL, Queue is a type of container that follows FIFO (First-in-First-Out) elements arrangement i.e. the elements which insert first will be removed first. In queue, elements are inserted at one end known as "back" and are delete…
python循环1-31Baldric groggily opened his eyes and was greeted by a splitting pain in his head. He had been having the strangest dream, something about a crystal, and a snake eating its own tail, and…a singing head of cabbage? Strange indeed. He looked a…
#按照给定字母序列对字符数组排序
def sort(sequence,strs):keylist(sequence) #序列转列表[d,g,e,c,f,b,o,a]value[i for i in range(len(sequence))] #value[0,1,2,3,4,5,6,7]dicdict(zip(key,value)) #dic{d:0,g:1,e:2,c:3,f:4,b:5,o:6,a:7}data,number[],[]for i in range(…
Something was really bothering Baldric about 106479825301.0, the answer to the mysterious request he’d received. Sitting down at his desk after enduring his meeting with Kevin, he realized what it was. If you only looked at the answer’s whole number port…
python 示例列出index()方法 (List index() Method) index() method is used to get the index of the specified element, the method is called with this list and element can be supplied as an argument, it returns the index of the first occurrence of the element i…
实例:模糊查询 def el_inList_eachEl(self,el,list):for i in list:if el in i:log1.info(查询元素【{0}】,列表查询为【{1}】,查询结果成功!!!.format(el,i))else:log1.error(查询元素【{0}】,列表查询为【{1}】,查询结果错误&am…
python pdb调试Debugging applications can sometimes be an unwelcome activity. You’re busy working under a time crunch and you just want it to work. However, at other times, you might be learning a new language feature or experimenting with a new approach a…
打印特殊方阵
打印一个N*N的方阵(3<N<23),最外层为“T”,第二层为“J”,从第三层开始,依次打印1、2、3……,下图为N11的情形。
T T T T T T T T T T T
T J J J J J J J J J T
T J 1 1…
1、python--遇到SyntaxError: Non-UTF-8 code starting with \xb8 in file 在运行python中因为添加了中文注释,遇到SyntaxError: Non-UTF-8 code starting with \xb8 in file 经过百度,说是Python的默认编码格式是UTF-8,若指定编码格式则需在…
对于列表中的数字进行全排列,然后寻找能被7整除的数。
def Method(arr,p,q):if pq:s.append(list(arr))else:for i in range(p,q):arr[i],arr[p]arr[p],arr[i]Method(arr,p1,q)arr[i],arr[p]arr[p],arr[i]s[]
res0
arrlist(input().strip().split())
Method(arr,0,…
目录 零、简介一、Reading二、Search三、Modification四、Ordering 零、简介
列表在CMake中大量使用。初始化列表语法如下:
set(myList a b c) # Creates the list "a;b;c"归根结底,列表只是一个由分号分隔列表项的单个字符串,这…
String字符串类型 字符串基本操作 127.0.0.1:6379> set name yorick # 设置值
OK
127.0.0.1:6379> get name # 获取值
"yorick"
127.0.0.1:6379> keys * # 获取全部key
1) "name"
127.0.0.1:6379> exists name # 判断name是否存在
(integer) 1…
Trivia: 琐事: We all want our elements inside the web page to be in a particular order as it helps in displaying the web page in a sorted and well-arranged manner. The convention is to choose from various types of lists. There are majorly three…
熊猫烧香教程In this tutorial we will learn how to work with comma separated (CSV) files in Python and Pandas. We will get an overview of how to use Pandas to load CSV to dataframes and how to write dataframes to CSV. 在本教程中,我们将学习如何在P…
import numpy as np# a 和 b 是两个属性为 array 也就是矩阵的变量,而且二者都是1行4列的矩阵, 其中b矩阵中的元素分别是从0到3。
a np.array([10, 20, 30, 40])
b np.arange(4)
# 矩阵减法
c a - b
# 矩阵加法
c a b
# 矩阵乘法
c a * b
# array(…
python中访问列表元素访问列表 (Accessing a list) To access a list – we can simply print the list object and the complete list prints as an output. 要访问列表,我们可以简单地打印列表对象,然后将完整的列表作为输出打印。 print (list_objec…
#计算点(5,5)方圆2单位长度范围内点的数量
import xlrd
import math
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt#将excel的两列转化为列表
worksheet xlrd.open_workbook(uC:/Users/Administrator/Desktop/data.xlsx)…
Android中实现列表的方式有ListView、GrildView、ExpandableListView,后边出来另一个非常好用的RecyclerView,那么今天我们就看看flutter如何实现列表显示的。
import package:flutter/material.dart;
//数据源
final Set<Person> sets new Set&…
简述
给定两个int 数组,根据每个位置进行相加计算。并输出结果。
Java 实现
public class ArrayAddition {public int[] add(int[] arr1, int[] arr2) {int l Math.max(arr1.length, arr2.length);int[] result new int[l];int c 0;int i arr1.length - 1;in…
C11扩大了用大括号括起来的列表的适用范围,简单来说就是可以更加方便的初始化了,我们不用再去写号了,如:
int x {5};
double y{2.75};
int quar[5] {1,2,3,4,5};
int *arnew int [4] {2,4,6,8};class A
{
private:int a;int b;
p…
Iteration means executing the same block of code over and over, potentially many times. A programming structure that implements iteration is called a loop. 迭代意味着一次又一次地执行同一段代码。 实现迭代的编程结构称为循环 。 In programming, there are two …
python中的字典生成式Python provides another composite data type called a dictionary, which is similar to a list in that it is a collection of objects. Python提供了另一种称为字典的复合数据类型,它类似于列表,因为它是对象的集合。 Here’s…
基本数据类型pythonNow you know how to interact with the Python interpreter and execute Python code. It’s time to dig into the Python language. First up is a discussion of the basic data types that are built into Python. 现在,您知道如何与Python解…
求阶乘欧拉函数阶乘和 (Factorial Digit Sum) Warning: Please only read this post, when you are absolutely sure, that you don’t want to take part in the challenge that is Project Euler. My posts will spoil the solution for you. I’m posting my solutions to s…
python 桌面备忘录The printable version of this cheat sheet 该备忘单的可打印版本 It’s common when first learning Python for Data Science to have trouble remembering all the syntax that you need. While at Dataquest we advocate getting used to consulting th…
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;public class Main {static int n; //元素个数static int[] a; //元素数组static int k; //需得到的数字static ArrayList<Integer> res new ArrayList();public static void main(Stri…
切片遍历列表的弊端
不建议通过切片遍历列表,例如for i in list1[::-1]: print(i),因为当通过切片来拿列表中的元素的时候,会根据切片方式生成一个新的列表,造成浪费。所以一般我们通过索引的方式来遍历列表,例如 for…
列表初始化及字符串转列表
>>> a 6
>>> b 8
>>> t [a 2, b - a] # 列表这里是动态的
>>> t
[8, 2]
>>> t list(this is a string) # 字符串转换为列表,将其展开
>>> t
[t, h, i, s, , i, s, , a, ,…
小编换了AirPods Pro ,长时间使用之后,我发现这款耳机降噪效果非常好,音质比之前的白开水改善了不少,长时间佩戴舒适,还有人把 AirPods Pro 当夜间入眠的耳塞用。用了一圈耳机,还是 AirPods Pro 比较香&…
python3的列表生成式主要有3种:
for循环if ------- [i for i in xxx if x xxx]for循环if else --------- [i if exp1 else exp2 for i in xxx]多层for循环 ----------- [for i in xxx for j in xxx]
# 列表生成式1 for循环if
# [i for i in xxx if x xxx]
# 此处…
2018年4月13日Click to join our mailing list and receive automatic updates on all future BaselR events.单击以加入我们的邮件列表,并接收有关将来所有BaselR事件的自动更新。 成为演讲者 (Be a speaker) Volunteering to speak at a BaselR event is a great …
1.冒泡排序算法
# 冒泡排序算法(从小到大)
#方法1
def bubblesort(data):nlen(data)for i in range(0,n):for j in range(i1,n):if data[i]>data[j]:data[i],data[j]data[j],data[i]return data
if __name__ __main__:a[58,47,69,20,15,66,52,80,30,64]print(bubblesort(a…
python判断奇数和偶数In this problem, we are given a list by the user which may be the mixture of even and odd numbers and based on the concept of even and odd, we will split the list into two lists and one will contain only even numbers and another will co…
insert方法 c#C#List <T> .Insert()方法 (C# List<T>.Insert() Method) List<T>.Insert() method is used to insert an element at specified index in the list. List <T> .Insert()方法用于在列表中的指定索引处插入元素。 Syntax: 句法…
python井字棋游戏Question: 题: You will be given a completed board of Tic-Tac-Toe. The cells will be represented by X and O. If there are any empty cells, they will be represented by #. X is used by Player 1 and O is used by Player 2. Given the …
列表嵌套str嵌套列表A rant 夸大其词 Do you ever get the urge to kill? How many of us cringe whenever we see these words? Lately I’ve been spending a lot of time developing pythonpackages.com, (now running on heroku!) during which time I see a lot of the…
python中字典列表元组Lists and tuples are arguably Python’s most versatile, useful data types. You will find them in virtually every nontrivial Python program. 列表和元组可以说是Python最通用,最有用的数据类型。 您几乎可以在每个平凡的Python程序中找…
数据结构 图形化What you will learn? 您将学到什么? In this article we are going to study how graph is being represented? 在本文中,我们将研究图形如何表示 ? Following is an undirected graph, 以下是无向图, We ca…
Apache spark and pyspark in particular are fantastically powerful frameworks for large scale data processing and analytics. In the past I’ve written about flink’s python api a couple of times, but my day-to-day work is in pyspark, not flink. With any d…
关注了就能看到更多这么棒的文章哦~ Linux 5.12s very bad, double ungood day By Jonathan Corbet March 8, 2021 DeepL assisted translation https://lwn.net/Articles/848431/ Linus Torvalds 发布内核的 -rc release 是确有必要的:在两周时间的合并…
#字符串中出现的第一个最长重复子串
class commonsubstring():def maxlen(self,s1,s2): #最长公共子串的长度for i in range(min(len(s1),len(s2))):if s1[i]s2[i]:i1else:break return idef getMaxCom(self,strs):nlen(strs)suf[None]*n #用于存放后缀字符串数组maxSubLen0 #…
MySQL sql Rank()函数实现 两列数据,以a列作为分组,查找以b列倒序的第一个。 select a,b,rownum,rank from (select tt.a,tt.b,rownum:rownum1 rownum,#rownum变量加1,作为rownumber, if(temptt.a,rank:rank1,rank:1) as rank,#tt.a字…
集合类fill()方法 (Collections Class fill() method) fill() method is available in java.util package. fill()方法在java.util包中可用。 fill() method is used to fill all the elements in the given list(l) with the given element (ele). fill()方法用于用给定元素( …
题目:给定一个列表a[3,4,5,6,6,5,4,3,2,1,7,8,8,3],请设计一个函数,实现传入一个target3,输出3这个元素在列表a中的索引,输出格式如下:[0,7,13]
for index, nums in enumerate(a):if nums target:b.append(index)
pr…
python 示例设置remove()方法 (Set remove() Method) remove() method is used to remove a specified element from the set, the method accepts an element and removes from the set if it exists, if the element does not exist in the set, the method returns an error…
kotlin 字符串反转Given a string, we have to reverse its each word. 给定一个字符串,我们必须反转其每个单词。 Example: 例: Input:string "Hello world"Output:"olleH dlrow"程序在Kotlin中反转每个单词 (Program to revers…
#求两个字符串的最长公共子串(动态规划法)
def getMaxSub(str1,str2):n1len(str1)n2len(str2)s[] #公共子串maxs0 #最长公共子串的长度maxI0 #记录最长公共子串最后一个字符的位置list1list(str1)list2list(str2)M[([None]*(n11)) for i in range(n21)] #(n11)*(n21)维空矩阵&a…
python中appendPython list supports variety of built-ins functions in which append() and insert() are two functions Python列表支持各种内置函数,其中append()和insert()是两个函数 1) Python append() method 1)Python append()方法 append() method is u…
一、列表(List)
1. 列表的特点
数据按顺序存储列表有正序、倒序两种索引列表可存储任意类型的数据,并且允许重复。
2. 列表的遍历:
lst[1,2,3]
for i in range(len(lst)):print(lst[i],end" ")3. 列表的缺点&#x…
写在前面本系列适合0基础的人食用,这是利用Excel学习Python系列的第5篇文章之前的列表都复习好了吗:python数据结构:列表are u ready?另一种数据结构:字典,要来了字典(dict),是用大括…
5.1 一个简单示例
示例中的循环首先检查当前的汽车名是否是‘bmw’。如果是,就以全大写的方式打印它;否则就以首字母大写的方式打印:
>>> cars
[audi, bmw, subaru, toyota]
>>> for car in cars:
... if car bmw:
.…
Jared Tobin is one of our consultants at fugue.co—he’s a programmer and researcher based out of Auckland, New Zealand. Jared’s article in this month’s issue of PragPub, The Pragmatic Bookshelf’s magazine affiliation, is a helpful read if you’re inter…
编程神奇算法由Bryan Berend | 2017年3月23日 (by Bryan Berend | March 23, 2017)About Bryan: Bryan is the Lead Data Scientist at Nielsen. 关于布莱恩(Bryan) : 布莱恩(Bryan)是尼尔森(Nielsen&#…
python 内置函数Magic-wielding escapees were desperately deflecting the Imperial attacks on the fortress’ supports as best they could. Ranks of longbowmen rained down arrows, but conjured gusts of wind sent many of them flying back the other way. The rebel…
创建python软连接Linked list is one of the famous data structure that people come across. It is a linear data structure that is stored in memory in non-contagious fashion. One can access elements of a linked list from the start only, unless reference to oth…
word如何插入无序列表In order to implement an unordered linked list we need to construct linked list which contains Node class, a building block for constructing linked list 为了实现无序链表,我们需要构建包含Node类的链表,Node类是构建链表…
Python列表经典实例
list1 []
character input("请输入西游记中你喜欢的人物:")
while(character):list1.append(character)character input("请输入西游记中你喜欢的人物:")
for i in range(0,len(list1)):print(("你喜欢的人物是:%s…
原文地址为:
Python 元组、列表、字典、文件转自http://yangsq.iteye.com/category/20857
python的元组、列表、字典数据类型是很python(there python is a adjective)的数据结构。这些结构都是经过足够优化后的,所以如果使用好的…
Qualities added to the rundown depend on the file position and it is requested by list position. 添加到摘要的质量取决于文件位置,列表位置要求它。 Types of Lists are: 列表类型为: Array List 数组列表 Vector 向量 Linked List 链表 1)数组…
java 获取list索引Given a list of integers and we have to access/retrieve element/object from given index from the list in Java. 给定一个整数列表,我们必须从Java列表中的给定索引访问/检索元素/对象。 To get the element from given index - we use Lis…
Python100例 我的实现展示(1-100例)
import calendar
import math
import random
import time
import turtle
from collections import Counter
from tkinter.ttk import Stylefrom click._compat import raw_input
from colorama import Back, Fore
from tkinter import *1、…
Python100例 我的实现展示(71-75例) 71、编写input()和output()函数输入,输出5个学生的数据记录。(开放性题目,跟着模仿写的代码)
n 3
student []def test_exam_71_input_stu(str1):for i in range(5):student.append([, , []])…
Python100例 我的实现展示(1-5例)
1、有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少?
import mathdef test_exam_01():list_x []for a in range(1, 5):for b in range(1, 5):if a ! b:for c in ran…
Python写九九乘法表有两种方式:for和while循环
for循环
for i in range(1,10):for j in range(1,i1):print("%d*%d %d \t" % (i, j, i * j), end"")print()while循环
k 1
while k <10:z 1while z < k:print({}*{}{}.format(z, k, z…
原文地址为:
Python list 数据类型:列表列表与字典(还没接触到)是Python中两个主要的数据类型。他们可以被修改,可以增长可以缩短,也可以嵌套。
列表 list
列表可以完成大多数集合类的数据结构实现。它…
LinkedList公共对象pollFirst()方法 (LinkedList public Object pollFirst() method) This method is available in package java.util.LinkedList.pollFirst(). 软件包java.util.LinkedList.pollFirst()中提供了此方法。 This method is used to retrieves the first or initi…