01:198:111 Lecture 28: 12/10 - Final Exam Review

372 views2 pages
Verified Note

Document Summary

Suppose an array is given with some invalid entries(indicated by -999). Write a program to remove the invalid entries and adjust the array while keeping the order of the entries that are valid, and add 0 to the end of the array that is unfilled. E. g. if you remove one -999 then there should be at least one 0 at the end of the array. Use an extra array of the same length. Copy over any element that is not -999 over into the new array. Any leftover elements would already be defaulted to 0 when you create it. Create a loop that edits the original array. Anytime the loop goes through the -999 it swaps the value with the next valid entry that is not -999. Then change the -999"s that at the end into. Write recursive function ispalindrome(char[] a) which takes an array of characters and return true if the characters represent a palindrome.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents