• Member for 6 years, 7 months
  • Last seen more than 3 years ago
Sorting an array of boolean values
4 votes

You can do this in linear time. Algo: 1. Initialize an another array of same size(n) lets name it A[n]. 1a. countF = 1 and countT = 1 2. Loop over elements with i going from 1:n on the original ...

View answer
How static Bayesian networks are stored? Like Hugin etc
Accepted answer
1 votes

For anyone who shares this same query. I have found a link that answers it. Further, found a implementation as well.

View answer
Lookup complexity in B-trees [Database]
0 votes

Nvm, figured it out. One access would be required to find the root of B-tree. And then Logd(n/2) access to find the correct leaf containing the right key. And then another another block access to ...

View answer
$A$ and $B$ are Turing-recognizable and their union is $\Sigma^*$, find a decidable $C$ with $A - B \subseteq C$ and $B - A \subseteq \overline{C}$
0 votes

I believe 'C' is not also turing decideable. Consider the following 3 cases: Case 1 : Intersection of A and B is empty set and neither of them is empty. Then A and B become Turing Decidable, ...

View answer
How do I sort these elements in O(n) time?
-1 votes

I really doubt anyone can sort an array within O(n) unless infinite memory is given. However, if you know the range of numbers and have sufficient memory to store all of them, then you can hash the ...

View answer