今天没有新动态
@kidultff

PAT-A 真题 - 1095 Cars on Campus

Zhejiang University has 6 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the gate. Now with all the information available, you are supposed to tell, at any s ...
  • 0
  • 0
@kidultff

PAT-A 真题- 1010 Radix

Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a decimal number and 110 is a binary number.Now for any pair of positive integers N1 and N2, you ...
  • 1
  • 0
@kidultff

数据结构与算法-7-43 字符串关键字的散列映射

给定一系列由大写英文字母组成的字符串关键字和素数P,用移位法定义的散列函数H(Key)将关键字Key中的最后3个字符映射为整数,每个字符占5位;再用除留余数法将整数映射到长度为P的散列表中。例如将字符串AZDEG插入长度为1009的散列表中,我们首先 ...
  • 0
  • 0
@kidultff

数据结构与算法-7-42 整型关键字的散列映射

给定一系列整型关键字和素数P,用除留余数法定义的散列函数将关键字映射到长度为P的散列表中。用线性探测法解决冲突。输入格式:输入第一行首先给出两个正整数N(≤1000)和P(≥N的最小素数),分别为待插入的关键字总数、以及散列表的长度。第二行 ...
  • 0
  • 0
@kidultff

数据结构与算法-7-28 搜索树判断

对于二叉搜索树,我们规定任一结点的左子树仅包含严格小于该结点的键值,而其右子树包含大于或等于该结点的键值。如果我们交换每个节点的左子树和右子树,得到的树叫做镜像二叉搜索树。现在我们给出一个整数键值序列,请编写程序判断该序列是否为 ...
  • 0
  • 0