Skip to content

Commit

Permalink
Fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ss18 committed Jan 12, 2018
1 parent 0567717 commit e15381d
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Include contains single header implementation of data structures and some algori
### Cracking the coding interview problems
| Problem | Solution |
| :------------ | :----------: |
| 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)|
| 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)|
| 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)|
| 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)|
| 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)|
Expand Down
2 changes: 1 addition & 1 deletion bit_manipulation/right_most_set_bit.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Problem : One line function to return the position of right most bit.
* Approach : take 2's compliment and it with number.
* And finally taking a log of 2 + 1 will give us the positon
* And finally taking a log of 2 + 1 will give us the position
*/

#include <iostream>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Cracking the coding interview, edition 6
* Problem 1.1
* Write an algorithm to determine whether a string has unique characters or not
* Can we do it without using addtional data structures?
* Can we do it without using additional data structures?
*/


Expand Down
4 changes: 2 additions & 2 deletions cracking_the_coding_interview_problems/1-3-URLify.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Cracking the coding interview Edition 6
* Problem 1.3 URLify --> Replace all the spaces in a string with '%20'.
* Assumption : We have enough space to accomodate addition chars
* Assumption : We have enough space to accommodate addition chars
* Preferebly in place
*/

Expand All @@ -10,7 +10,7 @@

/*
* Function : urlify
* Args : string long enough to accomodate extra chars + true len
* Args : string long enough to accommodate extra chars + true len
* Return : void (in place transformation of string)
*/

Expand Down
2 changes: 1 addition & 1 deletion cracking_the_coding_interview_problems/2-2-kthToLast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* 1. Iterative:
* Use two pointers
* Move first pointer k places.
* Now move second pointer(from start) and first pointer (from k+1) simultanously.
* Now move second pointer(from start) and first pointer (from k+1) simultaneously.
* When second pointer would have reached end, first pointer would be at kth node.
*
* 2. Recursive:
Expand Down
2 changes: 1 addition & 1 deletion leet_code_problems/shortest_path_maze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int shortestPath(const std::vector<std::vector<int>>& matrix,
const Point& source,
const Point& destination)
{
// An auxillary matrix to keep track of visited points
// An auxiliary matrix to keep track of visited points
// initially all cells are marked unvisited.
//
std::vector<std::vector<bool>> visited(
Expand Down
4 changes: 2 additions & 2 deletions string_problems/robinKarpStringMatching.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* 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.
* 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.
* example : T => "AABAACAADAABAAABAA".
* P => "AABA"
* Output : 0, 9, 13 ( all indices of T where pattern string P is starts to match.
Expand All @@ -10,7 +10,7 @@
* Lets have a hash function --> hash.
* Step 1 :We will calculate hash of Pattern P, lets say it is p
* Step 2 : Then we will calculate hash of text portion from T[0-->M-1]. lets say t(0)
* Step 3: if ( p == t(0) ) if they match, add it to list of occurances.
* Step 3: if ( p == t(0) ) if they match, add it to list of occurrences.
* Step 4: Go back to step 2, and calculate t(1) i.e hash of T[1-->M] using t(0) in O(1).
*
* The question remains, how do we calculate t(1) from t(0) in O(1), we do it using Horner's rule
Expand Down

0 comments on commit e15381d

Please sign in to comment.