Most Popular

1500 questions
11
votes
4 answers

What's the difference between user registers and kernel registers?

I am reading Operating Systems: Three Easy Pieces, but I can't fully understand the following paragraph. It's from the 6th chapter of the book. I think it's self-contained, so I quote here. Note that there are two types of register saves/restores…
Bicheng
  • 225
  • 2
  • 7
11
votes
1 answer

Independent set on cubic triangle-free graphs

I know that maximum independent set on cubic triangle-free graphs is NP-complete. Is it still NP-complete in case we require the independent set to be of size exactly $|V|/2$? Basiclly, YES instance of independent set problem on cubic triangle-free…
Mohammad Al-Turkistany
  • 4,417
  • 1
  • 26
  • 35
11
votes
3 answers

Is there an algorithm for checking if a string is a catenation of palindromes?

Is there a linear-time algorithm to check that a sequence of characters is a concatenation of palindromes? The only thing that comes to my mind is the naive solution: 1. k = 1 2. Split string into k substrings (all possibilities) and check 3. k++ 4.…
mrk
  • 3,688
  • 22
  • 35
11
votes
3 answers

Is it possible to decide if a given algorithm is asymptotically optimal?

Is there an algorithm for the following problem: Given a Turing machine $M_1$ that decides a language $L$, Is there a Turing machine $M_2$ deciding $L$ such that $t_2(n) = o(t_1(n))$? The functions $t_1$ and $t_2$ are the worst-case running…
StaticBug
  • 213
  • 1
  • 6
11
votes
2 answers

An example of something you can formally verify with proofs in Software Development

I have been working on understanding formal verification of software. Formal methods include things like modeling your software with Petri Nets, Automata, or State-Transition Graphs. Other techniques for formal verification include using type…
Lance
  • 2,213
  • 1
  • 17
  • 31
11
votes
3 answers

How often is Prolog/ASP used in non-research areas?

I've just recently found out about KRR (Knowledge representation and Reasoning) and ASP, not hearing a thing about them before (except a bit about prolog). I've read a bit about them and one of their primary usage seems to be AIs. My question would…
FloriOn
  • 211
  • 1
  • 3
11
votes
1 answer

Explaination for Variation of Boyer-Moore Majority voting algorithm

Boyer-Moore's majority vote algorithms can be used to determine the majority element in a linear time and constant space. The intuition behind finding the majority element is understandable as it has to be greater than the count of other elements…
thebenman
  • 213
  • 2
  • 7
11
votes
0 answers

Advantages of algorithm W over algorithm J for type inference in Hindley-Milner type system

According to A modern eye on ML type inference Furthermore, for some unknown reason, W appears to have become more popular than J, even though the latter is viewed—with reason!—by Milner as a simplification of the former. Jones’…
Alexey Romanov
  • 3,182
  • 18
  • 22
11
votes
2 answers

Theoretical minimum number of registers for a modern computer?

I took a course on compilers in my undergraduate studies in which we wrote a compiler that compiles source programs in a toy Java-like language to a toy assembly language (for which we had an interpreter). In the project we made some assumptions…
BlueBomber
  • 1,297
  • 12
  • 15
11
votes
0 answers

Covering a complete graph with n copies of an arbitrary graph: NP-complete?

Given a complete graph $G$, an arbitrary graph $H$, and a positive integer $n$, are there subgraphs $A_1,\dots,A_n$ of $G$ (not necessarily disjoint) such that their union is $G$, and each of them are isomorphic to $H$? This is a problem which…
11
votes
2 answers

Why do we need so many sorting algorithms?

We have some best sorting methods like quick sort, merge sort etc., then why we need other sorting methods which perform poor?
user82923
11
votes
1 answer

Intuition behind the Master Theorem

The Master Theorem provides a method of solving recurrence relations for divide-and-conquer algorithms. It was first presented to me in my intro algorithms class as the following: For a recurrence of the form $T(n) = aT(\frac{n}{b})+f(n)$ with…
roctothorpe
  • 1,158
  • 8
  • 20
11
votes
3 answers

Polymorphism and Inductive datatypes

I'm curious. I've been working on this datatype in OCaml: type 'a exptree = | Epsilon | Delta of 'a exptree * 'a exptree | Omicron of 'a | Iota of 'a exptree exptree Which can be manipulated using explicitly typed recursive functions (a…
Stéphane Gimenez
  • 1,490
  • 1
  • 14
  • 29
11
votes
2 answers

Is there any standard for comparing runtimes experimentally?

My situation I am writing a paper presenting a software module I developed and I want to compare its runtime to other modules for the same task. I am aware of the drawbacks of runtime experiments, but please assume as given that there is no way…
Wrzlprmft
  • 245
  • 1
  • 9
11
votes
2 answers

Find largest and second largest elements of the array

So here is a HW problem I have been working. On I was wondering if anybody could give me a hint of what I am doing wrong. I don't want to be given the answer just hints and advice on how to solve it. I am given this simple algorithm that finds the…
SPD
  • 211
  • 1
  • 2
  • 4