Question: 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
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]
Step by Step Solution
3.42 Rating (158 Votes )
There are 3 Steps involved in it
Id be glad to provide a response that combines the strengths of previous responsesaddresses identified issuesand incorporates insights from ratings a ... View full answer
Get step-by-step solutions from verified subject matter experts
