Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
2 answers
396 views

Check if point is inside a bitmap shape

Inspired by this question, here's some C code to check if a point is "inside" of a shape on a simple black and white bitmap. For this exercise: Set bits form the "outlines" of a ...
user673679's user avatar
  • 11.9k
4 votes
1 answer
293 views

Sudoku solver using backtracting and depth-first-search

I've recently finished my first ever C program. I implemented a Sudoku solver that uses backtracking. Does my code look like a proper C-program? Are there any recommendations for improving my code? <...
Ivan Shelomentsev's user avatar
10 votes
2 answers
4k views

Generating the powerset in C

I am solving another problem in leetcode. Given a set, generate all the subsets of the set. Input: [1,2,3] Output: ...
wispymisty's user avatar
2 votes
0 answers
792 views

Max flow Ford-Fulkerson using DFS augmented path retrieval

I have written a naive max flow with DFS, could anyone review my below code. What can be done to improve the code and what are the worst cases where this won’t work acceptably? ...
Sazzad Hissain Khan's user avatar
0 votes
1 answer
2k views

Iteratively-Deepening Depth First Search (queue and non-queue)

I am aware that most 'generic' BFS algorithms that use a queue also check for uniqueness of visitation to 'speed things up' as it were, but I'm a bit unclear as to how to implement such a method as I'...
rjs's user avatar
  • 143
2 votes
1 answer
7k views

Breadth- and Depth-first search code

Here is my breadth-first search (bfs) and depth-first search (dfs) code for graph traversal. Please give me some constructive ...
abhay  jain's user avatar
12 votes
1 answer
336 views

Depth-first search method for searching for all "superpalindromes" whose prime factors are all <=N

A question was asked over at math.SE (here) about whether or not there are infinitely many superpalindromes. I'm going to rephrase the definition to a more suitable one for coding purposes: ...
Douglas S. Stones's user avatar