import sys
#链表的三种插入形式
class employee:
def __init__(self):
self.num=0
self.salary=0
self.name=''
self.next=None
def del_ptr(head,ptr):
top=head
if ptr.num==head.num:
head=head.next #删除链表头部
print('已删除第%d号 员工姓名:%s 薪资:%d'%(ptr.num,ptr.name,ptr.salary))
else:
while top.next!=ptr:
top=top.next
if ptr.next==None:
top.next=None #删除链表尾部
print('已删除第%d号 员工姓名:%s 薪资:%d'%(ptr.num,ptr.name,ptr.salary))
else:
top.next=ptr.next #删除链表内部任意位置
print('已删除第%d号 员工姓名:%s 薪资:%d'%(ptr.num,ptr.name,ptr.salary))
return head
def main():
findword=0
data=[[1001,32367],[100