Submitted by heartin on Sun, 06/21/2015 - 19:02
Write an algorithm for string compression using counts of repeated characters
E.g. aaaaarrrrbbb will become a5r4b3
Additional note: if the new compressed string is is bigger than the original string, return original string. [node:read-more:link]
Submitted by heartin on Mon, 06/15/2015 - 12:20
Given two strings, write an algorithm to find if one string is a permutation (or anagram) of the other.
Submitted by heartin on Thu, 06/11/2015 - 21:01
Write an algorithm to find out if a string has all unique characters.
Submitted by heartin on Wed, 08/06/2014 - 10:45
String interning is a method of storing only one copy of each distinct string value. Strings in Java are immutable and hence this sharing is perfectly safe and give you better performance. The distinct values are stored in a fixed-size hashtable usually referred to as string intern pool or string pool. The single copy of each string is called its 'intern'. You can read more about the basics of String interning with examples @ string-interning-in-java-with-examples. [node:read-more:link]
Submitted by heartin on Fri, 02/14/2014 - 07:52
A String is a sequence of characters (e.g. "Hello World").
A String is an object in java, and not a primitive.
We can create a String object in two ways:
Assigning a String literal to a String variable