11 Topics

Member Avatar for
Member Avatar for midyajai

I am trying to understand Boyer Moore algorithm & KMP algorithm (Knuth Morris Pratt)? I tried some places like GeeksForGeeks, TutorialsPoint etc. But I have still some doubts. If you guys have some resources or videos where these algorithms are explained in somewhat simple terms, please share them. First I …

Member Avatar for Alisha_8
-1
710
Member Avatar for Snehashish Das

## Traversal In Binary Tree : ## **Preorder traversal (NLR) :** 1. Visit the root(N) 2. Traverse the left subtree of root in preorder(L) 3. Traverse the right subtree of root in preorder(R) **Inorder Traversal (LNR) :** 1. Traverse the left subtree of root in inorder(L) 2. Visit the root(N) …

1
124
Member Avatar for rose_2

If I have the following code, let's say the Parent class has the complexity of O(n^2) according to methods included in the Parent. So if I want to calculate the complexity of inherited class (Child class), does it take the Parent class complexity and its own complexity? something like that …

Member Avatar for AssertNull
0
345
Member Avatar for dev90

How to calculate time complexiy of the following line of code using 'Big-O' or 'Big-OH' notation??? 1. scanf("%d",&n); 2. for(i=1,m=n+66;i<=m;i++) 3. printf("%d \n",i); 4. for(j=n/21,m=n/5;j<=m;j++) 5. printf("%d \n",j); I have basic idea but i am getting confused...So, please help me to calculate time complexity of each step, plus overall complexity. …

Member Avatar for Sokurenko
0
291
Member Avatar for NumOne

Hi I need to prove the following statements: 1) for any a>1, and any b, a^n ∈ ω(n^b). We have to prove f(n) > C.g(n) for all C>0, n0>0 and n>=n0 a^n > C . n^b Since a > 1 , I think a >= n and a > b …

Member Avatar for rubberman
0
106
Member Avatar for apines

I see that there are many questions here regarding complexity analysis, specifically regarding the Big-O notation of algorithms. I will attempt to shed some light on the subject. I will start with an introduction, after which I will go over some common complexities and last we will solve a few …

Member Avatar for Rashakil Fol
13
1K
Member Avatar for imfatyourefat

So here's the question: Suppose as min heap uses parent pointers such that each node contains a pointer to its parent and the root has a null pointer. Given a pointer to the node, which isn't the root of the tree, containing the max key in the heap, what is …

Member Avatar for Rashakil Fol
0
189
Member Avatar for justinbailey

I have to answer with the runtime for Big O for a few examples of C++ code. I'm generally having some trouble grasping the concept of Big O but two particular problems are stumping me: [CODE]cin >> x; double n = example(x); for ( i =0; i << n; i++) …

Member Avatar for justinbailey
0
169
Member Avatar for pandaEater

I've been working on getting the Big-Oh notation for this code segment a couple days now and I can't figure it out. I've most likely come across the right answer but I can't convince myself it's right. What's the Big-Oh notation for the following code and how do you arrive …

Member Avatar for gashtio
0
378
Member Avatar for Ajantis

Hey folks :) I am studying for my final exam, and I have some issues with this Big Oh notation. Really - I've been reading about it like crazy, but I just can't to understand it all properly. What I know is that it is some kind of measurement of …

Member Avatar for DarkT
0
348
Member Avatar for seven11

I need help in determining,using Big-O notation, the upper-bound for these two algorithms i wrote. They both do the same thing but are coded differently. They both look for all the prime numbers up to some limit, N. This first algorithm: [CODE] public static void algo1(){ primes = new int[n]; …

Member Avatar for Rashakil Fol
0
120

The End.