Strings Flashcards

1
Q

What is a String?

A

A sequence of characters. Many tips that apply to arrays also apply to strings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Time Complexity of Inserting an element to a String

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Time Complexity for Removing an element in a String

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Time Complexity for Searching for an element in String

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Time Complexity for Accessing an element in a String

A

O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

4 Common Corner Cases (String problems)

A
  1. empty string
  2. String with 1 or 2 characters
  3. String with repeated characters
  4. String with only distinct characters
How well did you know this?
1
Not at all
2
3
4
5
Perfectly