6.4. Summary

Programmers use strings and arrays all the time, so it's not surprising to see problems about them showing up in a programming interview. A string can even be thought of as an array of characters — and if not actually implemented that way, there's usually an easy way to convert it to an array and back.

Arrays are not treated identically in all languages. All languages support static arrays, but few offer native support for dynamic arrays. C++ and C don't do any bounds checking of array access, whereas Java and C# do.

String manipulation is so fundamental that it's normally handled via built-in library routines or system classes. Languages like C# and Java consider strings to be immutable, making changes to a string nontrivial and requiring the use of special mutable string classes. If you're not careful, string manipulation can greatly degrade the performance of your algorithms.

You should know how to convert a string to an array of characters and back for each language you're using, because your answers to many interview problems will require such conversions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.61.142