Click here to Skip to main content
15,868,016 members
Home / Discussions / C#
   

C#

 
AnswerRe: call an api in c# Pin
Dave Kreskowiak16-Nov-15 4:06
mveDave Kreskowiak16-Nov-15 4:06 
AnswerRe: call an api in c# Pin
Pete O'Hanlon16-Nov-15 5:51
subeditorPete O'Hanlon16-Nov-15 5:51 
GeneralRe: call an api in c# Pin
Member 1212120116-Nov-15 17:50
Member 1212120116-Nov-15 17:50 
AnswerRe: call an api in c# Pin
Gerry Schmitz16-Nov-15 18:40
mveGerry Schmitz16-Nov-15 18:40 
QuestionDocument to represent a document node in a print queue Pin
Tridip Bhattacharjee14-Nov-15 1:08
professionalTridip Bhattacharjee14-Nov-15 1:08 
AnswerRe: Document to represent a document node in a print queue Pin
OriginalGriff14-Nov-15 1:21
mveOriginalGriff14-Nov-15 1:21 
QuestionPrint Queue implementation by linked list class Pin
Tridip Bhattacharjee14-Nov-15 1:06
professionalTridip Bhattacharjee14-Nov-15 1:06 
AnswerRe: Print Queue implementation by linked list class Pin
OriginalGriff14-Nov-15 1:20
mveOriginalGriff14-Nov-15 1:20 
Start by creating your PrintQueue class - add a private Head variable which is a Document. Add a Next property to your Document class which is also a Document. This allows you to create the linked list.

And add the Push and Pop methods (though I wouldn't call them that myself because "push" and "pop" have specific meanings in computing, and I'd expect a Push followed by a Pop to return the document I Pushed, not the first in the list - I'd use GetHead and AddTail instead myself).

Since this is your homework, I'll not give you the code - it's pretty simple anyway - but for Push, just traverse the list until you find a null value Next, and set your new document there.
For Pop, check if there are any items in the Head, and remove it to a temporary variable, setting the value of Head to the Next value of the Document you removed. Set the Next value of the temporary value to null, and return the temporary value.

I'd suspect that you want the Document class to be abstract as well.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: Print Queue implementation by linked list class Pin
Tridip Bhattacharjee14-Nov-15 5:12
professionalTridip Bhattacharjee14-Nov-15 5:12 
GeneralRe: Print Queue implementation by linked list class Pin
OriginalGriff14-Nov-15 5:29
mveOriginalGriff14-Nov-15 5:29 
GeneralRe: Print Queue implementation by linked list class Pin
Tridip Bhattacharjee14-Nov-15 5:22
professionalTridip Bhattacharjee14-Nov-15 5:22 
GeneralRe: Print Queue implementation by linked list class Pin
OriginalGriff14-Nov-15 5:35
mveOriginalGriff14-Nov-15 5:35 
GeneralRe: Print Queue implementation by linked list class Pin
Tridip Bhattacharjee14-Nov-15 8:27
professionalTridip Bhattacharjee14-Nov-15 8:27 
GeneralRe: Print Queue implementation by linked list class Pin
Tridip Bhattacharjee14-Nov-15 18:33
professionalTridip Bhattacharjee14-Nov-15 18:33 
GeneralRe: Print Queue implementation by linked list class Pin
OriginalGriff14-Nov-15 23:23
mveOriginalGriff14-Nov-15 23:23 
GeneralRe: Print Queue implementation by linked list class Pin
Tridip Bhattacharjee15-Nov-15 21:14
professionalTridip Bhattacharjee15-Nov-15 21:14 
GeneralRe: Print Queue implementation by linked list class Pin
OriginalGriff15-Nov-15 21:25
mveOriginalGriff15-Nov-15 21:25 
QuestionParallel vs Threading Pin
Ger Hayden14-Nov-15 0:22
Ger Hayden14-Nov-15 0:22 
AnswerRe: Parallel vs Threading Pin
Gerry Schmitz14-Nov-15 9:42
mveGerry Schmitz14-Nov-15 9:42 
GeneralRe: Parallel vs Threading Pin
Ger Hayden14-Nov-15 11:27
Ger Hayden14-Nov-15 11:27 
GeneralRe: Parallel vs Threading Pin
Gerry Schmitz14-Nov-15 20:29
mveGerry Schmitz14-Nov-15 20:29 
GeneralRe: Parallel vs Threading Pin
Ger Hayden15-Nov-15 9:50
Ger Hayden15-Nov-15 9:50 
GeneralRe: Parallel vs Threading Pin
Gerry Schmitz15-Nov-15 10:22
mveGerry Schmitz15-Nov-15 10:22 
GeneralRe: Parallel vs Threading Pin
Ger Hayden18-Nov-15 3:24
Ger Hayden18-Nov-15 3:24 
QuestionMoving Data from one form to another Pin
KakitaIppatsu13-Nov-15 14:45
KakitaIppatsu13-Nov-15 14:45 

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.