# 计算机代写|算法分析作业代写Introduction to Algorithms代考|CSCl2300

## 计算机代写|算法分析作业代写Introduction to Algorithms代考|Hashing and authentication

Let $\mathscr{H}$ be a family of hash functions in which each hash function $h \in$ $\mathscr{f}$ maps the universe $U$ of keys to ${0,1, \ldots, m-1}$.
a. Show that if the family $\mathscr{H}$ of hash functions is 2 -independent, then it is universal.
b. Suppose that the universe $U$ is the set of $n$-tuples of values drawn from $\mathbb{Z}p={0,1, \ldots, p-1}$, where $p$ is prime. Consider an element $x=$ $\left\langle x_0, x_1, \ldots, x{n-1}\right\rangle \in U$. For any $n$-tuple $a=\left\langle a_0, a_1, \ldots, a_{n-1}\right\rangle \in U$, define the hash function $h_a$ by $h_a(x)=\left(\sum_{j=0}^{n-1} a_j x_j\right) \bmod p$.
Let $\mathscr{H}=\left{h_a: a \in U\right}$. Show that $\mathscr{H}$ is universal, but not 2independent. (Hint: Find a key for which all hash functions in $\mathscr{H}$ produce the same value.)
c. Suppose that we modify $\mathscr{H}$ slightly from part (b): for any $a \in U$ and for any $b \in \mathbb{Z}p$, define $h{a b}^{\prime}(x)=\left(\sum_{j=0}^{n-1} a_j x_j+b\right) \bmod p$
and $\mathscr{H}^{\prime}=\left{h_{a b}^{\prime}: a \in U\right.$ and $\left.b \in \mathbb{Z}p\right}$. Argue that $\mathscr{H}$ is 2-independent. (Hint: Consider fixed $n$-tuples $x \in U$ and $y \in U$, with $x_i \neq y_i$ for some $i$. What happens to $h{a b}^{\prime}(x)$ and $h_{a b}^{\prime}(y)$ as $a_i$ and $b$ range over $\mathbb{Z}_p$ ?)
d. Alice and Bob secretly agree on a hash function $h$ from a 2

## 计算机代写|算法分析作业代写Introduction to Algorithms代考|Binary Search Trees

The search tree data structure supports each of the dynamic-set operations listed on page 250: SEARCH, MINIMUM, MAXIMUM, PREDECESSOR, SUCCESSOR, INSERT, and DELETE. Thus, you can use a search tree both as a dictionary and as a priority queue.

Basic operations on a binary search tree take time proportional to the height of the tree. For a complete binary tree with $n$ nodes, such operations run in $\Theta(\lg n)$ worst-case time. If the tree is a linear chain of $n$ nodes, however, the same operations take $\Theta(n)$ worst-case time. In Chapter 13, we’ll see a variation of binary search trees, red-black trees, whose operations guarantee a height of $O(\lg n)$. We won’t prove it here, but if you build a binary search tree on a random set of $n$ keys, its expected height is $O(\lg n)$ even if you don’t try to limit its height.

After presenting the basic properties of binary search trees, the following sections show how to walk a binary search tree to print its values in sorted order, how to search for a value in a binary search tree, how to find the minimum or maximum element, how to find the predecessor or successor of an element, and how to insert into or delete from a binary search tree. The basic mathematical properties of trees appear in Appendix B.

# 算法分析代考

## 计算机代写|算法分析作业代写Introduction to Algorithms代考|Hashing and authentication

b. 假设宇宙 $U$ 是一组 $n$ – 从中得出的值的元组 $\mathbb{Z} p=0,1, \ldots, p-1$ ，在哪里 $p$ 是质数。考虑一个元榡 $x=\left\langle x_0, x_1, \ldots, x n-1\right\rangle \in U$. 对于任何 $n$-元组 $a=\left\langle a_0, a_1, \ldots, a_{n-1}\right\rangle \in U$ ， 定义哈布函数 $h_a$ 经过 $h_a(x)=\left(\sum_{j=0}^{n-1} a_j x_j\right) \bmod p$. 㳍函数都在 $\mathscr{H}$ 产生相同的价值。)
C。假设我们修改 $\mathscr{H}$ 部分 (b) 略有不同：对于任何 $a \in U$ 对于任何 $b \in \mathbb{Z} p$ ， 定义
$h a b^{\prime}(x)=\left(\sum_{j=0}^{n-1} a_j x_j+b\right) \bmod p$

## 计算机代写|算法分析作业代写Introduction to Algorithms代考|Binary Search Trees

myassignments-help数学代考价格说明

1、客户需提供物理代考的网址，相关账户，以及课程名称，Textbook等相关资料~客服会根据作业数量和持续时间给您定价~使收费透明，让您清楚的知道您的钱花在什么地方。

2、数学代写一般每篇报价约为600—1000rmb，费用根据持续时间、周作业量、成绩要求有所浮动(持续时间越长约便宜、周作业量越多约贵、成绩要求越高越贵)，报价后价格觉得合适，可以先付一周的款，我们帮你试做，满意后再继续，遇到Fail全额退款。

3、myassignments-help公司所有MATH作业代写服务支持付半款，全款，周付款，周付款一方面方便大家查阅自己的分数，一方面也方便大家资金周转，注意:每周固定周一时先预付下周的定金，不付定金不予继续做。物理代写一次性付清打9.5折。

Math作业代写、数学代写常见问题

myassignments-help擅长领域包含但不是全部: