b. Add a class member function which outputs if the linked list in Problem a. is a palindrome. What is the Big-O upper bound? c. What change could be made to the class definition in Problem a. to make your solution in Problem b. more efficient? Explain. What is the Big-O upper bound? Hint: Think of how the palindrome determination problem is solved for a regular string.
b. Add a class member function which outputs if the linked list in Problem a. is a palindrome. What is the Big-O upper bound? c. What change could be made to the class definition in Problem a. to make your solution in Problem b. more efficient? Explain. What is the Big-O upper bound? Hint: Think of how the palindrome determination problem is solved for a regular string.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
B and C
![All the problems are to be coded in Python/Java. You must explicitly solve each problem
below using your own logic. For example, Do not use existing library functions, such as sum(
), which computes the sum of a list. Instead, you must use for/while loop to sum up the items
in a list.
a. Write code for a CharList class which converts a string to a linked list of characters in the
string.
b. Add a class member function which outputs if the linked list in Problem a. is a palindrome.
What is the Big-O upper bound?
c. What change could be made to the class definition in Problem a. to make your solution in
Problem b. more efficient? Explain. What is the Big-O upper bound? Hint: Think of how
the palindrome determination problem is solved for a regular string.
d. Add a method to the classic List class we discussed in class that reverses the list. That is,
if the original list is A -> B ->C, all of the list's links should change so that C-> B-> A.
Make your solution as efficient as possible. You may modify the List class to fit your needs.
e. Let's say you have access to a node from somewhere in the middle of a classic linked list,
but not the linked list itself (the head node is not available). That is, you have a variable
that points to an instance of Node, but you don't have access to the LinkedList instance. In
this situation, if you follow this node's link, you can find all the items from this middle
node until the end, but you have no way to find the nodes that precede this node in the list.
Write code that will effectively delete this node from the list. The entire remaining list
should remain complete, with only this node removed.
70°F M.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F2b11db84-233f-49d3-87bd-f59d69831d4e%2F029b270d-b97a-41d6-a0c9-7a7549e90e96%2Fst3lons_processed.jpeg&w=3840&q=75)
Transcribed Image Text:All the problems are to be coded in Python/Java. You must explicitly solve each problem
below using your own logic. For example, Do not use existing library functions, such as sum(
), which computes the sum of a list. Instead, you must use for/while loop to sum up the items
in a list.
a. Write code for a CharList class which converts a string to a linked list of characters in the
string.
b. Add a class member function which outputs if the linked list in Problem a. is a palindrome.
What is the Big-O upper bound?
c. What change could be made to the class definition in Problem a. to make your solution in
Problem b. more efficient? Explain. What is the Big-O upper bound? Hint: Think of how
the palindrome determination problem is solved for a regular string.
d. Add a method to the classic List class we discussed in class that reverses the list. That is,
if the original list is A -> B ->C, all of the list's links should change so that C-> B-> A.
Make your solution as efficient as possible. You may modify the List class to fit your needs.
e. Let's say you have access to a node from somewhere in the middle of a classic linked list,
but not the linked list itself (the head node is not available). That is, you have a variable
that points to an instance of Node, but you don't have access to the LinkedList instance. In
this situation, if you follow this node's link, you can find all the items from this middle
node until the end, but you have no way to find the nodes that precede this node in the list.
Write code that will effectively delete this node from the list. The entire remaining list
should remain complete, with only this node removed.
70°F M.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY