$30
Goals •
to program a few elementary data structures so we can experiment with them later on.
Requirements
and Notes • Develop a singly linked list.
• Using your linked list, develop a stack. You must implement it yourself;
you may not use any built-in features of the language or its libraries.
• Using your linked list, develop a queue. You must implement it yourself;
you may not use any built-in features of the language or its libraries.
• Download the the text Jile magicitems.txt from our web site.
• Read it line by line into array.
• Check each element of the array to see if it’s a palindrome. (Ignore
spaces and capitalization.) Print it if so.
‣ To check whether or not a given string is a palindrome, take it
character by character and push each on a stack and enqueue each
on a queue. When every character is on a stack and in a queue, pop
the stack and dequeue the queue one character at a time. If they
always match, then the string is a palindrome. (There are other ways
to check for palindromes. I don’t care. Do it this way.)
• Create a LaTeX document that includes code listings (with line
numbers) for your stack, queue, and main program. Explain how each
works, referencing line numbers in the listings to be really clear.
[20 points]
[20 points]
[20 points]
[30 points]
[10 points]
Your code must …
• separate structure from presentation.
• be professionally formatted yet uniquely yours (show some personality)
• use and demonstrate best practices.
• make me proud to be your teacher.
[−∞ if not]
Resources • Linked lists are described in our text in chapter 10.2, starting on page EC.
• Stacks and queues are described in our text in the beginning of chapter 10, starting on
page 1110 1000.
Hints Make sure that I have approved of your programming language (the one about which you
wrote a limerick in Assignment 0) before you begin.
Submi6ng