Thread: help ..please help me doing this .....problem.

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    3

    Question help ..please help me doing this .....problem.

    Suppose L is a LIST and p, q, and r are positions. As a function of n, the length of list L, determine how many times the functions FIRST, END, and NEXT are excused by the following program.

    p := FIRST(L);
    while p <> END(L) do begin
    q := p;
    while q <> END(L) do begin
    q := NEXT(q,L);
    r := FIRST(L);
    while r <> q do
    r := NEXT(r,L);
    end;
    p := NEXT(p,L);
    end;

    I need to know what eaxctly meant by the brackets
    <> .... q<>END(L) does it mean as long as q is not at the end of the list?? please help!!!!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > q<>END(L) does it mean as long as q is not at the end of the list?
    That would be my guess.

    But this looks like Pascal to me

    It isn't C for sure...
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User Engineer's Avatar
    Join Date
    Oct 2001
    Posts
    125

    Red face

    What language are using? Doesn't look like C nor C++ to me....
    1 rule of the Samurai Code: if you have nothing to say, don't say anything at all!

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Pascal.

    The <> means !=

    Quzah.

  5. #5
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    <>

    This is also != in VB, too.

  6. #6
    Registered User
    Join Date
    Oct 2001
    Posts
    3
    Now, please tell me what != means ......
    When it's written
    while r <> q do
    what exactly it means ..please

  7. #7
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    First off, you're on a C board. That code is Pascal. You're in the wrong place. Second, if you don't know what "!=" means, then you're still in the wrong place.

    It means "not equal". In other words: r is not equal to q.

    Quzah.

  8. #8
    Registered User
    Join Date
    Oct 2001
    Posts
    3
    Thanks a lot.

  9. #9
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Um...what language are you trying to do this code in? This can be done in C, but you are not showing any signs that you know C. Do you? Because we can help out, if you a have the basics of the language.
    1978 Silver Anniversary Corvette

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM