PDA

View Full Version : any good programming challenge using the c language.


kant
Oct29-05, 11:28 PM
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?

Tide
Oct30-05, 01:01 AM
How about writing some extended (or infinite) precision numerical routines so you can calculate things like 10,000! etc.?

kant
Oct30-05, 03:28 AM
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.

dpm
Oct30-05, 06:31 AM
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).

dduardo
Oct30-05, 09:05 AM
There are loads of problems you can find here:

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

ComputerGeek
Oct30-05, 10:19 AM
How about figuring out how to write an algorithm for an NP problem that completes in O(log n)

:-P

just kidding.

Hurkyl
Oct30-05, 10:23 AM
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. :tongue:)

kant
Oct30-05, 03:13 PM
There are loads of problems you can find here:

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


Very nice link. thanks.

ComputerGeek
Oct30-05, 03:34 PM
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. :tongue:)

Yes :-) I thought about it after but was to lazy to change it.

ceptimus
Nov6-05, 11:53 AM
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.

neurocomp2003
Nov6-05, 06:26 PM
build a 3D engine.

saltydog
Nov8-05, 06:10 PM
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.).

olivia_ton
Nov15-05, 11:53 PM
Get into systems side with C, C++