Define a class called MyLinkedQueue containing two data field: head and tail. Create constructors, setters and getters as appropriate. Define an inner class called QueueNode inside MyLinkedQueue...




  1.  Define a class called
    MyLinkedQueue
    containing two data field: head and tail. Create constructors, setters and getters as appropriate.

  2. Define an inner class called
    QueueNode
    inside MyLinkedQueue containing necessary data fields, and constructors, to make sure the queue can move back and forth.

  3.  Implement the
    poll
    and
    offer
    methods for the MyLinkedQueue class.

  4.  Implement the
    isPalindrome
    method to the MyLinkedQueue class to check if the queue going forward is identical to the queue going backwards. For example, Queue {1,2,3,2,1} is Palindrome.


 Given an ArrayList of integers, return
indices of the two numbers such that they add up to a specific target. For example, Given nums = [2, 7, 11, 15], target=9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0,1].



Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here