Recent questions tagged algorithms

594
views
1 answers
3 votes
A hash table contains $10$ buckets and uses linear probing to resolve collisions. The key values are intergers and the hash function used is $\text{Key}\%10.$ ... $152$ be inserted?
245
views
0 answers
1 votes
Let us suppose we are given an integer $\text{N}$ in binary representation. Let us consider the following algorithm to check if $\text{N}$ is a prime.For every ... ? (Assume hypothetically that division can be done in $\text{O}(1)$ time).
273
views
0 answers
2 votes
How many topological sortings (or topological orderings) does the given directed graph have?
401
views
0 answers
1 votes
Let us suppose we are given an integer $N$ in binary representation. Let us consider the following algorithm to check if $N$ is a prime.For every $i$ ... answer the following.Explain why iterating till $\lceil\sqrt{N}\rceil$ is sufficient.
358
views
0 answers
1 votes
Consider the following graph.How many nodes (apart from $s$) does the Breadth First Search algorithm discover before discovering $t$ when starting from $s$.
444
views
1 answers
1 votes
Design an algorithm to construct one heap that contains all the elements of two given heaps of sizes n and m, respectively. The heaps are given in a linked-list ... time of the algorithm should be O(log(m + n)) in the worst case
571
views
2 answers
1 votes
what if a full binary tree contains both left and right sides as the max heap, then what will be the complexity of making it a proper max heap?
426
views
1 answers
0 votes
T(n)={0:if n<11:if n==1T(n-1)+T(n-2):n>1}if the stack size is 48 bytes and one stack entry size =4 B then maximum n=?I thought it should be 13 but ... are already given so can we take n=13 so the last call which will be stored will be T(2)
313
views
1 answers
0 votes
315
views
1 answers
0 votes
Can we write f(2$^{n/a}$) = Θ(2$^{n}$) for any integer a >0?
398
views
1 answers
3 votes
$Find \ Time \ Complexity :$ $T(n) =$ $n^{\frac{1}{3}}$ . T($n^{\frac{2}{3}}$) + $\Theta (n)$