Differentiate between a tree and a graph. a.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%
Differentiate between a tree and a graph.
b. Give code for a function delete(p) that deletes the node pointed to by p in a circular
linked list and returns a pointer to the node after the deleted node.
In an mxn matrix, where the row index varies from 1 to
m and column index from 1 to n, aij denotes the number
in the h row and the jh column. In the computer's
memory, all elements are stored linearly using contiguous
addresses. Therefore, to store a two-dimensional matrix,
two-dimensional address space must be mapped to one-
dimensional address space. In the computer's memory,
matrices are stored in either row-major order or column- Column-major order
major order form. In row-major order, the consecutive
elements of a row reside next to each other. In column-
major order, the consecutive elements of a column reside
а.
Row-major order
a a12 a13
a a22 a23
с.
a1 a12 a13
a23
a22
[5 1]
4 3
6 8
2 7]
next to each other. Consider the matrix A =
Base
address of the matrix is 3FA2H. Each element is stored in 2 bytes. Each memory
location is one byte long.
i. Give the addresses of 4 and 8 if the matrix is stored in row-major order.
ii. Give the addresses of 3 and 2 if the matrix is stored in column-major order.
iii. Give the element stored at the base address in both orders.
Question 2
a. Give pictorial depiction of an almost complete binary tree in which the left and right
subtrees of the root have different heights.
b. Give pictorial depiction of a binary search tree for the following values:
34, 26, 38, 22, 28, 25, 33, 40, 39.
c. Give pictorial depiction of a heap formed from the following values:
56, 23, 67, 70, 83, 35, 42, 57, 69.
Transcribed Image Text:Differentiate between a tree and a graph. b. Give code for a function delete(p) that deletes the node pointed to by p in a circular linked list and returns a pointer to the node after the deleted node. In an mxn matrix, where the row index varies from 1 to m and column index from 1 to n, aij denotes the number in the h row and the jh column. In the computer's memory, all elements are stored linearly using contiguous addresses. Therefore, to store a two-dimensional matrix, two-dimensional address space must be mapped to one- dimensional address space. In the computer's memory, matrices are stored in either row-major order or column- Column-major order major order form. In row-major order, the consecutive elements of a row reside next to each other. In column- major order, the consecutive elements of a column reside а. Row-major order a a12 a13 a a22 a23 с. a1 a12 a13 a23 a22 [5 1] 4 3 6 8 2 7] next to each other. Consider the matrix A = Base address of the matrix is 3FA2H. Each element is stored in 2 bytes. Each memory location is one byte long. i. Give the addresses of 4 and 8 if the matrix is stored in row-major order. ii. Give the addresses of 3 and 2 if the matrix is stored in column-major order. iii. Give the element stored at the base address in both orders. Question 2 a. Give pictorial depiction of an almost complete binary tree in which the left and right subtrees of the root have different heights. b. Give pictorial depiction of a binary search tree for the following values: 34, 26, 38, 22, 28, 25, 33, 40, 39. c. Give pictorial depiction of a heap formed from the following values: 56, 23, 67, 70, 83, 35, 42, 57, 69.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY