list1=[8,12,20,3,5,10,6],在列表的元素'12'前面插入一个新元素'20',以下语句正确的是( ) A: list1.insert(1,20) B: list1.insert(2,20) C: list1.insert[1,20] D: list1=insert(2,20)
list1=[8,12,20,3,5,10,6],在列表的元素'12'前面插入一个新元素'20',以下语句正确的是( ) A: list1.insert(1,20) B: list1.insert(2,20) C: list1.insert[1,20] D: list1=insert(2,20)
删除列表list1最后1个元素的语句是() A: list1.insert(10) B: len(list1) C: del list1[-1] D: print(list[10])
删除列表list1最后1个元素的语句是() A: list1.insert(10) B: len(list1) C: del list1[-1] D: print(list[10])
Given an empty linked list, the cost to insert n elements in the list is ___? A: Θ(1) B: Θ(n) C: Θ(n*n) D: Θ(log n)
Given an empty linked list, the cost to insert n elements in the list is ___? A: Θ(1) B: Θ(n) C: Θ(n*n) D: Θ(log n)
Which operations of linked list are more efficient than array based list? A: insert B: search C: remove D: setPos
Which operations of linked list are more efficient than array based list? A: insert B: search C: remove D: setPos
下面程序的运行结果为。 def swap(list): temp=list[0] list[0]=list[1] list[1]=temp list=[1,2] swap(list) print(list)
下面程序的运行结果为。 def swap(list): temp=list[0] list[0]=list[1] list[1]=temp list=[1,2] swap(list) print(list)
获取列表list=[1,2,3,4]第一个元素正确的方法是()。 A: list[-1] B: list[1] C: list[0] D: list[[1]]
获取列表list=[1,2,3,4]第一个元素正确的方法是()。 A: list[-1] B: list[1] C: list[0] D: list[[1]]
已知不带头结点的单链表L,下面用函数实现的在第一个元素前面插入值为x的元素结点的算法错误的是( ) A: void insert(List *L,elemtype x){ node d=new node(x); d.next=*L; *L=&d;} B: List * insert(List *L,elemtype x){ node d=new node(x); d.next=*L; *L=&d; return L;} C: void insert(List *L,elemtype x){ ptr p=*L; node d=new node(x); ptr q=&d; p->next=q; L=&q;} D: List insert(List *L,elemtype x){ node d=new node(x); d.next=*L; return &d;}
已知不带头结点的单链表L,下面用函数实现的在第一个元素前面插入值为x的元素结点的算法错误的是( ) A: void insert(List *L,elemtype x){ node d=new node(x); d.next=*L; *L=&d;} B: List * insert(List *L,elemtype x){ node d=new node(x); d.next=*L; *L=&d; return L;} C: void insert(List *L,elemtype x){ ptr p=*L; node d=new node(x); ptr q=&d; p->next=q; L=&q;} D: List insert(List *L,elemtype x){ node d=new node(x); d.next=*L; return &d;}
6. The most common operation for setting a linked list is to insert a node at the end and delete the tail node, so () is the most time-saving option. A: doubly linked circular list with a head node B: singly linked list C: singly linked circular list with a tail pointer D: singly linked circular list
6. The most common operation for setting a linked list is to insert a node at the end and delete the tail node, so () is the most time-saving option. A: doubly linked circular list with a head node B: singly linked list C: singly linked circular list with a tail pointer D: singly linked circular list
代码如下 #函数定义 def chanageList(list): list.append(" end") print("list",list) #调用 strs =['1','2'] chanageList() print("strs",strs) 下面对 strs 和 list 的值输出正确的是 A: strs ['1','2'] list ['1','2'] B: strs ['1','2','end'] list ['1','2','end'] C: list ['1','2','end'] strs ['1','2','end'] D: list ['1','2','end'] strs ['1','2']
代码如下 #函数定义 def chanageList(list): list.append(" end") print("list",list) #调用 strs =['1','2'] chanageList() print("strs",strs) 下面对 strs 和 list 的值输出正确的是 A: strs ['1','2'] list ['1','2'] B: strs ['1','2','end'] list ['1','2','end'] C: list ['1','2','end'] strs ['1','2','end'] D: list ['1','2','end'] strs ['1','2']
列表list = [1,2,3,4,5],下列选项中不能访问list末尾元素语句的是( )。 A: list[4] B: list[-1] C: list[len(list)-1] D: list.tail()
列表list = [1,2,3,4,5],下列选项中不能访问list末尾元素语句的是( )。 A: list[4] B: list[-1] C: list[len(list)-1] D: list.tail()