Click here to Skip to main content
15,904,153 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questiona needed program Pin
jwacho514-Mar-06 15:48
jwacho514-Mar-06 15:48 
AnswerRe: a needed program Pin
Ryan Binns14-Mar-06 17:09
Ryan Binns14-Mar-06 17:09 
QuestionRe: a needed program Pin
David Crow15-Mar-06 2:54
David Crow15-Mar-06 2:54 
AnswerRe: a needed program Pin
hint_5415-Mar-06 5:58
hint_5415-Mar-06 5:58 
QuestionIs it possible that the operation Insert AND DeleteMinimum on some data structure be done in constant time. Pin
JERKII.SHANG14-Mar-06 14:57
JERKII.SHANG14-Mar-06 14:57 
QuestionRe: Is it possible that the operation Insert AND DeleteMinimum on some data structure be done in constant time. Pin
JERKII.SHANG14-Mar-06 15:02
JERKII.SHANG14-Mar-06 15:02 
AnswerRe: Is it possible that the operation Insert AND DeleteMinimum on some data structure be done in constant time. Pin
David Crow15-Mar-06 2:56
David Crow15-Mar-06 2:56 
AnswerRe: Is it possible that the operation Insert AND DeleteMinimum on some data structure be done in constant time. Pin
Dan McCormick15-Mar-06 4:04
Dan McCormick15-Mar-06 4:04 
I think you will find that Insert in constant time and DeleteMinimum in constant time are mutually exclusive.

An unsorted linked list (or even a vector) will allow for Insert to occur in constant time (just add the new element to the end of the list), but DeleteMinimum would require a search to find the value and could not be done in constant time.

On the other hand a sorted linked list would let you perform DeleteMinimum in constant time (because you know the minimum value will always be the first [or last] element of the list). Insert into the sorted list, however, could not be done in constant time since you would have to determine where in the list to place a new entry.

So, you have a trade off. Do you want Insert to be efficient or DeleteMinimum to be efficient? You need to understand how an application will use data in order to choose the optimum data structure.

Regards,
Dan

Remember kids, we're trained professionals.
Don't try this at home!

GeneralRe: Is it possible that the operation Insert AND DeleteMinimum on some data structure be done in constant time. Pin
JERKII.SHANG15-Mar-06 13:13
JERKII.SHANG15-Mar-06 13:13 
QuestionEnable an dit box Pin
beardy janggut14-Mar-06 14:33
beardy janggut14-Mar-06 14:33 
AnswerRe: Enable an dit box Pin
Nibu babu thomas14-Mar-06 16:54
Nibu babu thomas14-Mar-06 16:54 
AnswerRe: Enable an dit box Pin
ThatsAlok14-Mar-06 18:01
ThatsAlok14-Mar-06 18:01 
QuestionArray size Pin
hint_5414-Mar-06 14:11
hint_5414-Mar-06 14:11 
AnswerRe: Array size Pin
Michael Dunn14-Mar-06 16:53
sitebuilderMichael Dunn14-Mar-06 16:53 
GeneralRe: Array size Pin
hint_5415-Mar-06 5:46
hint_5415-Mar-06 5:46 
AnswerRe: Array size Pin
Stephen Hewitt14-Mar-06 17:07
Stephen Hewitt14-Mar-06 17:07 
GeneralRe: Array size Pin
ThatsAlok14-Mar-06 18:13
ThatsAlok14-Mar-06 18:13 
AnswerRe: Array size Pin
JERKII.SHANG15-Mar-06 13:20
JERKII.SHANG15-Mar-06 13:20 
AnswerRe: Array size Pin
JERKII.SHANG15-Mar-06 13:28
JERKII.SHANG15-Mar-06 13:28 
GeneralRe: Array size Pin
hint_5415-Mar-06 13:34
hint_5415-Mar-06 13:34 
Questionbeginner ask for DirectX Pin
Karlzheng14-Mar-06 13:35
Karlzheng14-Mar-06 13:35 
QuestionDual language GUI Pin
JBAK_CP14-Mar-06 12:47
JBAK_CP14-Mar-06 12:47 
AnswerRe: Dual language GUI Pin
Maximilien14-Mar-06 13:50
Maximilien14-Mar-06 13:50 
Questionhow to disable Close button? Pin
includeh1014-Mar-06 12:37
includeh1014-Mar-06 12:37 
AnswerRe: how to disable Close button? Pin
Nibu babu thomas14-Mar-06 16:55
Nibu babu thomas14-Mar-06 16:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.