All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
Lost my pointer! (Posted on 2003-11-24) Difficulty: 3 of 5
You have a SINGLY linked list in memory of at least 1000 nodes (perhaps many more). I give you a pointer to ONE of the elements. (You don't know to which one.)

Upon examination, you discover that the pointer to the next node is not NULL (indicating that we're not at the last node in the list).

Your mission, should you decide to accept it, is to delete the current node, and maintain the valid linked list.

First, how do you go about doing that?

Second, how do you go about doing that in fixed space (i.e., you have only 64 bytes of memory as scratch space, so you can't replicate the rest of the linked list in memory, nor store more than 16 4-byte pointers)?

See The Solution Submitted by SilverKnight    
Rating: 2.0000 (5 votes)

Comments: ( You must be logged in to post comments.)
  Subject Author Date
re(3): Passed by (off topic....)Brian Wainscott2003-12-05 19:16:10
re(2): Passed bySilverKnight2003-12-04 17:24:27
re: Passed byBrian Wainscott2003-12-04 17:05:40
My solutionDavid Hanna2003-12-03 21:10:15
SolutionPassed byDJ2003-12-01 13:21:46
re: questions - well doneSilverKnight2003-11-25 13:04:39
questionsRushi2003-11-25 12:18:42
way over my head!drew2003-11-24 20:34:44
re: -Exactly!Tristan2003-11-24 18:57:41
No SubjectGamer2003-11-24 18:45:45
re(2): Seems simple enoughBrian Wainscott2003-11-24 18:13:58
re: me very confusedSilverKnight2003-11-24 17:27:19
me very confusedVictor Zapana2003-11-24 16:58:25
re: Seems simple enoughSilverKnight2003-11-24 16:45:08
Seems simple enoughBrian Wainscott2003-11-24 16:39:58
wow... don't everyone jump in at once....SilverKnight2003-11-24 16:14:30
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information