a. Briefly describe how the following data types are represented in Java using a combinations of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
a. Briefly describe how the following data types are represented in Java using a combinations of bits.(As an example, a double precision floating point number is represented using sixty four bits, using three sections, namely a 1bit sign, an 11 bit exponent and a 52 bit mantissa) i. A character } QUESTION2 [9 marks] List ii. iii. A single precision floating point number An integer A program is used to define a linked list as follows class Node (int data; Node link; NodeList, Prev,Pos; Figure 1 shows an ordered (sorted) linked list, with pointers Pos and Prev accessing specific nodes within the list. i. Prev Figure1: Representationofanorderedlinkedlist A node has been initialized with the value 2 by the following code Node newnode-new(Node); newnode.data=2; newnode.link- NULL; 11 Pos Diagrammatically represent the steps involved in getting the value 2 inserted into the list(before 5). [3marks] 13 a. Draw the pointer manipulations required if the value 9 was to be removed from the original list depicted in figure 1. [2marks] iii. Briefly explain why the time to search a linked list is 0(n). [2marks] b. ii. QUESTION3 [9 marks] iv. State one advantage and one disadvantage of representing an unsorted data set in a linked list as opposed to an array. [2marks] The values 8, 23, 3, 15, 2 have been inserted (in the order specified) into a (minimizing) binary heap. Show the resulting heap after EACH value has been inserted. [4marks] Draw an array that shows how the heap from question 3a can be stored in an array. [5marks] a. Briefly describe how the following data types are represented in Java using a combinations of bits.(As an example, a double precision floating point number is represented using sixty four bits, using three sections, namely a 1bit sign, an 11 bit exponent and a 52 bit mantissa) i. A character } QUESTION2 [9 marks] List ii. iii. A single precision floating point number An integer A program is used to define a linked list as follows class Node (int data; Node link; NodeList, Prev,Pos; Figure 1 shows an ordered (sorted) linked list, with pointers Pos and Prev accessing specific nodes within the list. i. Prev Figure1: Representationofanorderedlinkedlist A node has been initialized with the value 2 by the following code Node newnode-new(Node); newnode.data=2; newnode.link- NULL; 11 Pos Diagrammatically represent the steps involved in getting the value 2 inserted into the list(before 5). [3marks] 13 a. Draw the pointer manipulations required if the value 9 was to be removed from the original list depicted in figure 1. [2marks] iii. Briefly explain why the time to search a linked list is 0(n). [2marks] b. ii. QUESTION3 [9 marks] iv. State one advantage and one disadvantage of representing an unsorted data set in a linked list as opposed to an array. [2marks] The values 8, 23, 3, 15, 2 have been inserted (in the order specified) into a (minimizing) binary heap. Show the resulting heap after EACH value has been inserted. [4marks] Draw an array that shows how the heap from question 3a can be stored in an array. [5marks]
Expert Answer:
Answer rating: 100% (QA)
Solutions Step 1 QUESTION 1 a Briefly describe how the following data types are represented in Java using combinations of bitsAs an example a double precision floating point number is represented usin... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
In Exercises find the given higher-order derivative. 2 "(x) = 2 / f(x) X
-
Susan Lustier is 35 years old and employed as a tax accountant for a major oil and gas exploration company She earns nearly 5135.000 a year from her salary and from participation in the companies...
-
Meera Ltd.s comparative statements of financial position are presented below. Additional information: 1. Net income was 22,590. Dividends declared and paid were 16,500. 2. All other changes in...
-
Mavis Stores had two billing clerks during the year. Snow worked three months and White worked nine months. As the auditor for Mavis Stores, Jones, CPA, uses attributes sampling to test clerical...
-
Gary Stevens and Mary James are production managers in the Consumer Electronics Division of General Electronics Company, which has several dozen plants scattered in locations throughout the world....
-
What does Queen Elizabeth do to overcome her apprehension in her speech in the Movie "Elizabeth to the Rival Clergy? And what can we learn from this to apply to our own public speaking? Watch:...
-
Obtain the general solution of the following differential equations: (a) (D 2D + 5)y = 0 (b) (D6 + 9D* + 24D + 16)y = 0
-
A 4 kg block is attached to a horizontal spring, which is attached to wall (as shown). The spring has a stiffness of 1600 N/m and a relaxed length of 0.15 m. You pull the mass until the stretch of...
-
Consider the following Directed Graph G: a h b The graph G is connected. f How many loops does the graph G have? g va The graph G contains a cycle of length 5? Consider performing a breadth first...
-
a) Complete the third Column (Cum NCF $). Specify how many possible rate of returns
-
To determine whether each of these is a Red Black Tree or not. If not, which of the stated Red Black Tree property(ies) is not met? If there is more than one that does not meet the need, help me to...
-
Numerous engineering and scientific applications require finding solutions to a set of equations. Ex: 8x + 7y-38 and 3x - 5y--1 have a solution x = 3, y = 2. Given integer coefficients of two linear...
-
Crane's Custom Construction Company is considering three new projects, each requiring an equipment investment of $22.440. Each project will last for 3 years and produce the following net annual cash...
-
On January 1, Year 1, Head Ltd. purchased 50,000 common shares, representing 40% of the outstanding shares, of Toe Ltd. for $800,000. The assets of Toe included a building with a market value...
-
Air pollution generated by a steel mill is an example of a) a positive production externality. b) a negative production externality. c) a public good. d) the free-rider problem. State and local taxes...
-
An office supply company conducted a survey before marketing a new paper shredder designed for home use. In the survey, 80% of the people who tried the shredder were satisfied with it. Because of...
-
For the past 25 years Burton Hodge has been keeping track of how many times he mows his lawn and the average size of the ears of corn in his garden. Hearing about the Pearson correlation coefficient...
-
When is an estimator said to be consistent? Is the sample mean, x, a consistent estimator of ? Explain.
-
Consider the flat-plate heat transfer to be solved by the similarity approach. Show all the details leading to Eq. (18.15). What are the boundary conditions on \(\theta\) ? Extend your MATLAB code to...
-
For fluids with \(\operatorname{Pr} <1\) the velocity profile is assumed to be a cubic for \(y
-
Show all the steps leading to the integral balance equation (18.6) in the text. Use the following boundary conditions and verify Eq. (18.7). (i) At \(y=0, T=T_{\mathrm{S}}\). (ii) At...
Study smarter with the SolutionInn App