Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ will be adding must go in the proper folder.
- Kruskal’s Minimum Spanning Tree Algorithm
- Huffman Coding
- Prim’s Minimum Spanning Tree Algorithm
- Dijkstra’s Shortest Path Algorithm
- Dijkstra’s Shortest ah Algorithm
- Job Sequencing Problem
- K Centers Problem

Expand All @@ -53,12 +53,12 @@ will be adding must go in the proper folder.

### String Algorithms (Carries 2 points)

- Naive Pattern Searching
- Naive atern Searching
- KMP Algorithm
- Rabin-Karp Algorithm
- Boyer Moore Algorithm – Bad Character Heuristic
- Anagram Substring Search
- Aho-Corasick Algorithm for Pattern Searching
- Aho-Corasick Algorithm for atern Searching
- Longest Even Length Substring such that Sum of First and Second Half is same

### Dynamic Programming and Backtracking (Carries 3 points)
Expand All @@ -78,7 +78,7 @@ will be adding must go in the proper folder.

### Graph Algorithms (Carries 3 points)

- Longest Path in a Directed Acyclic Graph
- Longest ah in a Directed Acyclic Graph
- Topological Sorting
- Snake and Ladder Problem
- Biconnected Components
Expand Down
4 changes: 2 additions & 2 deletions c++/naive_pattern_searching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ int main()
vector <int> index;
cout<<"Enter the string here : ";
getline(cin,s);
cout<<"Enter the pattern you want to search here : ";
cout<<"Enter the atern you want to search here : ";
getline(cin,search_s);
search_stringSearch(search_s, s);
index=search_stringSearch(search_s, s);
cout << "The entered pattern occurs in the entered string at: "<<endl;
cout << "The entered atern occurs in the entered string at: "<<endl;
for(int i=0;i<index.size();i++)
cout<<index[i]<<" ";
return 0;
Expand Down
20 changes: 20 additions & 0 deletions python/naive_pattern_search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
def search(a, b):
m = len(a)
n = len(b)


for i in range(n - m + 1):
j = 0

while(j < m):
if (b[i + j] != a[j]):
break
j += 1

if (j == m):
print("pattern found at index ", i)


b = input("Enter Text: ")
a = input("Enter pattern to search: ")
search(a, b)