Create a linked list that is a palindrome

Assignment Help Data Structure & Algorithms
Reference no: EM132080134

You need the java code only please...

Using a Linked List structure, determine whether a linked list contains a Palindrome in integers. For example, the following is a Palindrome:

0-> 1 -> 2 -> 1 -> 0

To solve this problem, following these steps:

1.) reverse the linked list

2.) compare the reversed list to the original list

3.) if they're the same, you have a Palindrome.

Create the following methods in a driver class, and call them from main:

boolean isPalindrome(LinkedListNode head) ~ given the starting node of a linked list, will return whether the linked list is a Palindrome.

LinkedListNode reverseAndClone(LinkedListNode node) ~ given the starting node of a linked list, will return the starting node of the reversed linked list.

boolean isEqual(LinkedListNode one, LinkedListNode two) ~ given the starting node of 2 linked lists, will return whether they are both the same.

Define 2 global linkedList variables that can be accessed from anywhere, one for origLinkedList and the other for reversedLinkedList.

To test the program, in main method:

1. Create a linked list that is a Palindrome, and call the isPalindrome method. Test to ensure it returns True.

2. Create a linked list that is NOT a Palindrome, and ensure the call to isPalindrome returns a False.

Reference no: EM132080134

Questions Cloud

Write a java prohram to implement a method : Write a java prohram to Implement a method inPlaceInsertionSort() that takes an array of Clocks as an input.
Determining the price elasticity of demand : The demand curve for a product is given by QXd = 1,200 - 3PX - 0.1PZ where Pz = $300.
Cover the details of the design : Teesside University - A new product design has been recently completed. As a design engineer responsible for the design, you are required to deliver a report
Problem regarding the cost-benefit analysis : a) Compare the real worth, rather than the market values, of various goods and services. b) Compare the relative desirability of alternative distributions.
Create a linked list that is a palindrome : Create a linked list that is a Palindrome, and call the isPalindrome method. Test to ensure it returns True.
Demand and supply curves for a good : With this type of externality, in the absence of government intervention, the market equilibrium quantity produced will be (Greather/less) than the socially
Write a program that will convert distance measurements : Write a C++ program that will convert distance measurements from miles to kilometers.
Devise a scoring system for each objective : ENGINEERING DESIGN - DESIGN REPORT - EVALUATION - THE WEIGHTED OBJECTIVE METHOD - Teesside University - Calculate scores and weighted scores for each car
Create a list and simply implement enqueue and dequeue : Create a Queue. Fill the first list with numbers consecutively numbered from 2 to n where n is entered by the user .

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd