1.
Convert the following values to binary using the Divide by 2 algorithm. Show the stack of remainders.
- 17
- 45
- 96
add
method in reverse order? What kind of reference results? What types of problems may result?remove
method works when the item to be removed is in the last node.remove
method works when the item is in the only node in the linked list.<html> <head> <title> Example </title> </head> <body> <h1>Hello, world</h1> </body> </html>
I PREFER PI
is a palindrome that reads the same forward and backward if you ignore the blank characters.size
method, we counted the number of nodes in the list. An alternative strategy would be to store the number of nodes in the list as an additional piece of data in the head of the list. Modify the UnorderedList
class to include this information and rewrite the size
method.remove
method so that does not throw an exception in the case where the item is not in the list (by leaving the list unchanged).slice
method for the UnorderedList
class. It should take two parameters, start
and stop
, and return a copy of the list starting at the start
position and going up to but not including the stop
position.MinMaxUnorderedList
that is a child of UnorderedList
and adds a minimum
and maximum
property. This will allow users to access the minimum and maximum values in the list in an enqueue
and dequeue
operations.