Any good programming challenge using the c language.

AI Thread Summary
The discussion centers around seeking challenging programming problems while learning the C language. Participants suggest creating extended precision numerical routines to handle large calculations, such as computing factorials of large numbers like 10,000!. This involves representing numbers as strings and developing custom "big number" routines to overcome the limitations of C's built-in numerical types. Additional problem-solving ideas include developing algorithms for NP-complete problems, creating a pentomino solver, building a 3D engine, and implementing various applications like a neural network for number recognition, a multi-tasking operating system scheduler simulator, and a general-purpose plotting library with interactive features. Resources such as the ACM problem set are recommended for further challenges.
kant
Messages
388
Reaction score
0
I am currently in my second quarter learning the c language. The class is not hard at all, but i want some challenge problems. Are there any goods links?
 
Technology news on Phys.org
How about writing some extended (or infinite) precision numerical routines so you can calculate things like 10,000! etc.?
 
Tide said:
How about writing some extended (or infinite) precision numerical routines so you can calculate things like 10,000! etc.?

What do you mean by "precision numerical routines"? You have to be more specific.
 
He means represent your number as a string of characters and then write some routines to compute with the numbers. C's built in numerical types have a limited range, but if you write your own "big number" routines, the range is potentially infinite (given enough memory, of course).
 
There are loads of problems you can find here:

http://acm.uva.es/problemset/
 
Last edited by a moderator:
How about figuring out how to write an algorithm for an NP problem that completes in O(log n)

:-P

just kidding.
 
Searching a sorted list is an NP problem that has a solution that runs in O(log n) time. (Assuming a random access lookup counts as one unit of work)

(Yes, I know you meant NP-complete. :-p)
 
dduardo said:
There are loads of problems you can find here:

http://acm.uva.es/problemset/


Very nice link. thanks.
 
Last edited by a moderator:
Hurkyl said:
Searching a sorted list is an NP problem that has a solution that runs in O(log n) time. (Assuming a random access lookup counts as one unit of work)
(Yes, I know you meant NP-complete. :-p)

Yes :-) I thought about it after but was to lazy to change it.
 
  • #10
Solving puzzles where you have to arrange things is a good one. Normally recursion (where a function calls itself) is a good way to tackle these.

A pentomino solver is interesting. You'll find lots of these on the web, but to make it interesting, just read up on the problem and then write your own code.
 
  • #11
build a 3D engine.
 
  • #12
Some of my favorites:

1. A neural network which displays a small window allowing you to use the mouse to "draw" a number and then have the network interpret it.

2. A multi-tasking operating system scheduler (just a simulator). The quintessential reference: "A Scheduling Philosophy for Multi-processing Systems", ACM Journal, 60's or so.

3. A Drag-and-drop application which displays a drawing of a dorm, and allows you to drag-and-drop students into the rooms (all database operations updated concurrently).

4. A general-purpose plotting library: Supply a function and it plots a nice report on the screen. Try doing this in 3-D as well. Add features such as point-and-click operations on the graph (enlarging, reducing, etc.).
 
Last edited:
  • #13
Get into systems side with C, C++
 
Back
Top