11-10 CC150 First Chapter

Source: Internet
Author: User

Topic:

1.1 Implement an algorithm to determine if a string have all unique characters. What if the can not use additional data structures? _________________________________________________________________

PG95 1.2 Write code to reverse a c-style String. (c-string means that "ABCD" is represented as five characters, including the null character.) _________________________________________________________________

PG96 1.3 Design An algorithm and write code to remove the duplicate characters in a string without using any additional BU Ffer. Note:one or additional variables is fine. An extra copy of the array is not. Follow up Write The test cases for this method. _________________________________________________________________

PG97 1.4 Write A method to decide if both strings is anagrams or not.

_________________________________________________________________

PG 1.5 Write a method to replace all spaces in a string with '%20 '.

________________________________________________________________

PG 1.6 Given An image represented by an NxN matrix, where each pixel in the image was 4 bytes, write a method to rotate The image by degrees. Can does this in place?

________________________________________________________________

PG 101 1.7 Write An algorithm such so if an element in a MxN matrix is 0, its entire row and column are set to 0. ________________________________________________________________

PG 102 1.8 Assume you has a method issubstring which checks if one word is a substring of another. Given strings, S1 and S2, write code to check if S2 are a rotation of S1 using only one call to issubstring (i.e., "wat Erbottle "is a rotation of" Erbottlewat ").

Code:

11-10 CC150 First chapter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.