Skip to content

Commit e15381d

Browse files
committed
Fixed typos
1 parent 0567717 commit e15381d

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Include contains single header implementation of data structures and some algori
7676
### Cracking the coding interview problems
7777
| Problem | Solution |
7878
| :------------ | :----------: |
79-
| Problem 1-1 : Edition 6: Write an algorithm to determine whether a string has unique characters or not. Can we do it without using addtional data structures? | [1-1-hasUniqueChars.cpp](cracking_the_coding_interview_problems/1-1-hasUniqueChars.cpp)|
79+
| Problem 1-1 : Edition 6: Write an algorithm to determine whether a string has unique characters or not. Can we do it without using additional data structures? | [1-1-hasUniqueChars.cpp](cracking_the_coding_interview_problems/1-1-hasUniqueChars.cpp)|
8080
| Problem 1-2 : Edition 5: Reverse a string when you are a pass a null terminated C string.|[1-2-edi5-reverseString.cpp ](cracking_the_coding_interview_problems/1-2-edi5-reverseString.cpp)|
8181
| Problem 1-2 : Edition 6: Given two strings, determine if one is permutation of other.|[1-2-perm-strings.cpp](cracking_the_coding_interview_problems/1-2-perm-strings.cpp)|
8282
| Problem 1-3 : Edition 5: Write an algorithm to remove duplicate chars from a string.|[1-3-edi5-removeDuplicates.cpp](cracking_the_coding_interview_problems/1-3-edi5-removeDuplicates.cpp)|

bit_manipulation/right_most_set_bit.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Problem : One line function to return the position of right most bit.
33
* Approach : take 2's compliment and it with number.
4-
* And finally taking a log of 2 + 1 will give us the positon
4+
* And finally taking a log of 2 + 1 will give us the position
55
*/
66

77
#include <iostream>

cracking_the_coding_interview_problems/1-1-hasUniqueChars.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Cracking the coding interview, edition 6
33
* Problem 1.1
44
* Write an algorithm to determine whether a string has unique characters or not
5-
* Can we do it without using addtional data structures?
5+
* Can we do it without using additional data structures?
66
*/
77

88

cracking_the_coding_interview_problems/1-3-URLify.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Cracking the coding interview Edition 6
33
* Problem 1.3 URLify --> Replace all the spaces in a string with '%20'.
4-
* Assumption : We have enough space to accomodate addition chars
4+
* Assumption : We have enough space to accommodate addition chars
55
* Preferebly in place
66
*/
77

@@ -10,7 +10,7 @@
1010

1111
/*
1212
* Function : urlify
13-
* Args : string long enough to accomodate extra chars + true len
13+
* Args : string long enough to accommodate extra chars + true len
1414
* Return : void (in place transformation of string)
1515
*/
1616

cracking_the_coding_interview_problems/2-2-kthToLast.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* 1. Iterative:
1010
* Use two pointers
1111
* Move first pointer k places.
12-
* Now move second pointer(from start) and first pointer (from k+1) simultanously.
12+
* Now move second pointer(from start) and first pointer (from k+1) simultaneously.
1313
* When second pointer would have reached end, first pointer would be at kth node.
1414
*
1515
* 2. Recursive:

leet_code_problems/shortest_path_maze.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ int shortestPath(const std::vector<std::vector<int>>& matrix,
5454
const Point& source,
5555
const Point& destination)
5656
{
57-
// An auxillary matrix to keep track of visited points
57+
// An auxiliary matrix to keep track of visited points
5858
// initially all cells are marked unvisited.
5959
//
6060
std::vector<std::vector<bool>> visited(

string_problems/robinKarpStringMatching.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Given a string pattern(P) and large Text string (T), Write a function search( P , T) which provide all the occurances of P in T.
2+
* Given a string pattern(P) and large Text string (T), Write a function search( P , T) which provide all the occurrences of P in T.
33
* example : T => "AABAACAADAABAAABAA".
44
* P => "AABA"
55
* Output : 0, 9, 13 ( all indices of T where pattern string P is starts to match.
@@ -10,7 +10,7 @@
1010
* Lets have a hash function --> hash.
1111
* Step 1 :We will calculate hash of Pattern P, lets say it is p
1212
* Step 2 : Then we will calculate hash of text portion from T[0-->M-1]. lets say t(0)
13-
* Step 3: if ( p == t(0) ) if they match, add it to list of occurances.
13+
* Step 3: if ( p == t(0) ) if they match, add it to list of occurrences.
1414
* Step 4: Go back to step 2, and calculate t(1) i.e hash of T[1-->M] using t(0) in O(1).
1515
*
1616
* The question remains, how do we calculate t(1) from t(0) in O(1), we do it using Horner's rule

0 commit comments

Comments
 (0)