Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 41947

An algorithm is a sequence of well-defined steps that defines an abstract solution to a problem. Use this tag when your issue is related to design and analysis of algorithms.

3 votes
Accepted

Mergesort recurssion tree depth...logs

The merge sort algorithm creates a complete binary tree, which has depth 'd' and at each level, a total of n elements. So, 2d ≈ n, which implies d ≈ log2 n
Anjo's user avatar
  • 372
1 vote
Accepted

Big-O comparison different arrangements of similar code

Its O(N). When there are consecutive loops, we calculate time complexity as sum of time complexities of individual loops. for (int i = 1; i <=m; i += c) { // some O(1) expressions } for (i …
Anjo's user avatar
  • 372
5 votes

String matching algorithm - check if a string matches a pattern

There are various algorithms for pattern matching in string. Exact String matching algorithms Brute Force Rabin Karp Boyer-Moree KMP Aho Corasick etc. … You can have a look through all these algorithms. These algorithms will take optimum complexity like O(m),O(n+m) (in case of KMP for example). …
Anjo's user avatar
  • 372
1 vote
Accepted

How does the Galil's rule work on Boyer-Moore algorithm?

The algorithm is based on a simple principle. Suppose that we are trying to match a substring of length n. We are going to first look at character at index m. If that character is not in the string, w …
Anjo's user avatar
  • 372