Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Data Structure Expert

1. The functions f : {1, 2, 3} → {a, b} and g : {a, b} → {x, y, z} are given by f(1) = b, f(2) = b, f(3) = a, g(a) = y, g(b) = x.

(a) Classify each of f and g as bijective, injective, surjective, or neither.

(b) Find g ? f .

(c) Either find the inverse of g ? f or explain why g ? f is not invertible.

2. I want to develop a database of information about my book collection, which tells me about the authors and genres of the various books I own. At the moment I have books by Isaac Asimov, China Mieville, Peter F Hamilton and Arthur C Clarke, and I denote the set of authors by A = {A, M, H, C}, abbreviating each author by the initial of his surname. I am classifying the books as science fiction, fantasy, horror and non-fiction, so my set of genres is G = {s, f , h, n}, again using initial letters as abbreviations.

At the moment, I have science fiction works by China Mieville and Isaac Asimov, I have fantasy by Peter F Hamilton and China Mieville, horror by Peter F Hamilton and Arthur C Clarke, and non-fiction by Isaac Asimov.

(a) Give the relation R on A × G which represents this information. (You may use appropriate abbreviations.)

(b) Find the combination of projection and inverse projection maps which finds all authors by whom I have horror books.

(c) Find the combination of projection and inverse projection maps which find all writers who have written non-fiction or fantasy books in my collection.

3. (a) Draw the graph with adjacency matrix

2482_img1.png

where the columns and rows label vertices 1 to 5 in order.

(b) Use the adjacency matrix connectivity algorithm, starting by marking row 1 and crossing out column 1, to show whether this graph is connected.

(c) Calculate A 2 and hence find the number of paths of length 2 from vertex 1 to vertex 5.

(d) Find a breadth first spanning tree starting at vertex 3.

4. Use Dijkstra's algorithm to find the shortest path from node a to node f in the following graph.

2251_img2.png

5. Use the heapsort algorithm to put the following list of numbers in decreasing order:

8 2 4 7 1 3 5

You should explain in detail how the original heap is obtained, and then show your sequence of heaps and partial ordered lists.

6. Consider the symbols and frequencies:

o : 12 e : 10 n : 4 t : 6 s : 5 m : 3

(a) Find a Huffman code for this situation, and the average length of an encoded symbol.

(b) Assign the symbols to these codewords in a different order, and comment on the resulting average length.

7. Bob decides to use n = 221 = 13 × 17 and e = 11 as his public key for an RSA cryptosystem.

(a) Show that the decryption exponent is 35.

(b) Find the encrypted form of the message 16.

Data Structure, Computer Science

  • Category:- Data Structure
  • Reference No.:- M91379875
  • Price:- $50

Guranteed 36 Hours Delivery, In Price:- $50

Have any Question?


Related Questions in Data Structure

Data Communication Delivering Information anywhere

Topic: Data Communication Delivering Information anywhere. Write a 9-12 pages paper in which you: Present an overview of the origin and history of the concept. Describe the current use of and attitude toward the concept. ...

Problem regarding the management program

Problem: Looks like its just adding a save and load feature to the same file you sent me for python 3.5 Until now, you have had to leave your team management program running on your computer indefinitely since you did no ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As