# Tag Info

### Time complexity for searching $k-th$ element from starting and ending of a linked list

It’s a trick question. Finding the k-th number takes O(k). Finding the 8-th item can be done in a constant number of steps so it takes O(1). But with this kind of question, you are unlikely to do this ...

### Time complexity for searching $k-th$ element from starting and ending of a linked list

Lets talk of each case one by one: (FINDING FROM THE START) SINCE QUESTION HAS ASKED US TO FIND THE ELEMENT FROM THE START AND HAS TO REACH PARTICULARY TO A PLACE THAT IS 8 TH FROM THE START . ...

### What is the time complexity of this algorithm of finding all prime numbers?

The following complexity is not tight; however closeby: The complexity of the algorithm is at least $\Omega(n \sqrt{n}/\log^2 n)$ and at most $O(n \sqrt{n}/\log n)$. For any natural number $x$, the ...

### Finding growth rate of T(n) of a code segment

Let $I$ be the number of times the for i is executed, $J$ the number of times for j, and $K$ the number of times ...
Accepted

### Time Complexity of Linear Search vs Brute Force

They are both correct, but the N is different. Algorithmic brute force: Inputs: X: Size of each combination element N: Number of combination elements Algorithm generates all possible combinations and ...