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)
Id be glad to provide a response that combines the strengths of previous responsesaddresses identified issuesand incorporates insights from ratings a ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
1. A) Differentiate and simplify: f(x)=- [2.5] X-9 B) Use technology to graph f(x) and then sketch an accurate graph by hand below. On the graph, indicate the locations where f(x) is not...
-
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
-
Oprah is deciding between investment options. Both investments earn an interest rate of 7%, but interest on the first investment is compounded annually, while interest on the second investment is...
-
Hilo Company closes its books monthly. On September 30, selected ledger account balances are: Notes Receivable .........$31,000 Interest Receivable ....... 170 Notes Receivable include the following....
-
Consider the integral \(\int_{0}^{2 \pi} \frac{d \theta}{5-4 \cos \theta}\). a. Evaluate this integral by making the substitution \(2 \cos \theta=z+\frac{1}{z}\), \(z=e^{i \theta}\), and using...
-
Some tasks and the order in which they must be performed according to their assembly requirements are shown in the following table. These are to be combined into workstations to create an assembly...
-
Management of Mittel Rhein AG of Kln, Germany, would like to reduce the amount of time between when a customer places an order and when the order is shipped. For the first quarter of operations...
-
George and Harry Haygood are building contractors who specialize in the construction of private home dwellings, storage warehouses, and small businesses (less than 20,000 sq. ft. of floor space)....
-
Problem 2-14 (LG 2-7) Based on economists' forecasts and analysis, one-year Treasury bill rates and liquidity premiums for the next four years are expected to be as follows: 1R1 0.42% E(21) = 0.78%...
-
Describe the percentage of sales model and its potential pitfalls in the financial planning process at least 5 pitfalls .? course financial management ch.18
-
What do you think teamwork is, and how do you instill teamwork in your crew?
-
A stock is expected to pay a dividend of $4.85 per share next year. That dividend will grow at a constant rate of 3.70 percent per year in perpetuity. Investors require a rate of return of 10.50...
-
How would I evaluate the speakers delivery and what suggestions would you make for improvement also what characteristics of the speakers Contant we need improvement Sajjid Chinoy, 1996 University of...
-
The Long-Life Battery Co. generates $4 million of profits on sales of $10 million and has a degree of operating leverage of 3.2. What will profits be if sales increase to $12 million?
-
Skateboards Ltd has the following P&L: Gross profit from sale of goods 1 0 , 0 0 0 Increase in general provision for doubtful accounts 1 , 0 0 0 Traffic fines 5 0 0 Maintenance costs 2 , 0 0 0 Book...
-
How can a promoter avoid personal liability for pre-incorporation contracts?
-
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.
-
\(3 \pi+7 \sqrt{21}=7 \sqrt{21}+3 \pi\) Identify the property of real numbers that is being illustrated.
-
\((-10 \pi)+10 \pi=0\) Identify the property of real numbers that is being illustrated.
-
\(14 \times(3 \sqrt{2}+11.6)=14 \times 3 \sqrt{2}+14 \times 11.6\) Identify the property of real numbers that is being illustrated.
Study smarter with the SolutionInn App