Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
An algorithm is a sequence of well-defined steps that defines an abstract solution to a problem. Use this tag when your issue is related to design and analysis of algorithms.
0
votes
Compute equality comparison without comparison operators
Since all arithmetic operations return an integer, and the result of an equality comparison must be a boolean, this is clearly impossible.
Edit for updated question:
This should do the trick in C:
…
8
votes
Finding a 4-clique among $k$ node groups
First of all, the greedy strategy you outlined does not work. It may be possible that the node with highest degree is in a clique with lower total degree than the clique with the maximum degree.
Seco …
2
votes
Linked list implementation problem
This should really be on StackOverflow, not Computer Science, but here's an answer anyway.
There are a few points. First of all, your code is not a linked list. You created an unbounded array, an arr …
1
vote
Can a Boolean circuit be considered an algorithm?
I don't think so, because when we think of algorithms (say as Turing machines), they allow the input to be any size. …
7
votes
Accepted
Finding number not in list with wildcards
Reduce from SAT. Consider a CNF formula $\phi = C_1 \land C_2 \land \ldots \land C_m$ over a set of variables $\{x_i\}_{i=1}^n$. Construct an instance of your problem as follows:
For each clause $C_i …
2
votes
Accepted
Which of these simple data structures is most efficient when implementing a Dequeue?
We need to clearly separate interface interfaces (abstract data types) from implementation. You talk about implementing a deque, an ADT, in terms of a stack or queue, but those are themselves ADTs. We …