文件名称:adjust
介绍说明--下载内容均来自于网络,请自行研究使用
有一个自适应单链表。这个链表只能从最前端开始顺序单向查找待查元素;每次查找到一个元素后把它提升到链表的最前端,维持其他元素的相对关系不变。现在用该链表存储并查找正整数:给出一些待查的正整数,如果找到则输出查找过程中访问过的元素数目, 如果找不到,则输出-1.
输入第一行包含两个整数 n, m,即链表中元素的个数和查找的次数。第二行包含 n 个正整数,从链表前端开始依次序给出链表中的元素。这些元素保证两两不相等。以下 m 行每行包含一个正整数 c,表示一个待查元素。 -Have an adaptive single linked list. This list can only start from the front one-way in order to find a complete set of elements each element to find a list after it raised to the forefront, to maintain the relative relationship between the other elements remain unchanged. Now stored with the list and look for positive integers: given some unknown positive integer, if the search process to find the output number of elements visited, if not found, output-1.
Input The first line contains two integers n, m, that is, the number of elements in the list and find the number of times. The second line contains n positive integers, starting from the front of the list given by the order of the elements of the list. These elements ensure the pairwise equal. The following m lines each line contains a positive integer c, represents an unknown element.
输入第一行包含两个整数 n, m,即链表中元素的个数和查找的次数。第二行包含 n 个正整数,从链表前端开始依次序给出链表中的元素。这些元素保证两两不相等。以下 m 行每行包含一个正整数 c,表示一个待查元素。 -Have an adaptive single linked list. This list can only start from the front one-way in order to find a complete set of elements each element to find a list after it raised to the forefront, to maintain the relative relationship between the other elements remain unchanged. Now stored with the list and look for positive integers: given some unknown positive integer, if the search process to find the output number of elements visited, if not found, output-1.
Input The first line contains two integers n, m, that is, the number of elements in the list and find the number of times. The second line contains n positive integers, starting from the front of the list given by the order of the elements of the list. These elements ensure the pairwise equal. The following m lines each line contains a positive integer c, represents an unknown element.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
adjust\adjust.cpp
......\adjust.h
......\readme.txt
......\..lease\adjust.exe
......\release
adjust
......\adjust.h
......\readme.txt
......\..lease\adjust.exe
......\release
adjust