Monday, August 26, 2019
Introducation to computer science assingment Assignment
Introducation to computer science assingment - Assignment Example Q6. The value that can be retrieved from the table by the pop instruction is 11 C. this is because it is possible to get the pointer in to the first element of the vector through incrementing this pointer in order to access the second pointer. The value that will be found in the pointer after the pop operation is 12 A. on the other hand, the deque is not a guarantee of a contiguous storage which contains the same elements (10, 11 12) and getting the pointer to the first element does not guarantee that you will get access to the second pointer by incrementing the pointer (Finkel, 1996) Q7. Assuming that the stricture above represents a queue, the value that will be removed from the queue is 14.this is because it is obtained after several increments of 10. The head pointer will next point at 13 which will be the value before 14. *In order to obtain the left child of a certain index, we multiply the current index 2 and we add 1. *for us to get the right child on this specific index, we multiply the current index by 2 and then we add 2. Q10. The reference data types are used to refer to objects while the primitive data types usually contain some values. Some of the example of primitive data type includes the byte, int Boolean and the float. Q11. When writing a chessboard structure that has an 8-by-8 grid, the programmer can consider using arrays that contains chess like structure which is a two dimension array. In order to store the position of the chess piece. The two dimension array is used in pinpointing individual elements in the array (Finkel,
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.