Solved

Linked Lists

Posted on 2000-04-03
2
153 Views
Last Modified: 2012-05-04
a.write an iterative procedure with the following signature
procedure Reverse(var List:nodepointer)
hint:the procedure needs two local variables
b.write a recursive procedure with the following signature
procedure reverse (var List,tail:Nodepointer);no local variables needed.
c.Make a test drive to test if it is reversing.
0
Comment
Question by:sbash10
2 Comments
 
LVL 2

Accepted Solution

by:
yairy earned 100 total points
ID: 2682232
precedure Raverse(var List:nodepointer)
var
  i:interger;
  p:^nodepointer;
begin
  for i:=1 to 7 do
    writeln(i);

  p:=p^next;
  Reverse(p);
end;


procedure reverse (var List,tail:Nodepointer);
var
p:Nodepointer;
i,j:interger;
begin
  while tail!=NIL do
  begin
    tail:=tail->next;
  end;
end;
0
 

Author Comment

by:sbash10
ID: 2683417
Why don't two people give an answer so that I compare the two to get the best?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Enable/Disable the Windows 7 'START' button 9 1,480
JSon parser in Delphi 1 6,744
Pass a string reference from one unit to another 8 114
Wininet read php file from internet issue 6 91
If you thought ransomware was bad, think again! Doxware has the potential to be even more damaging.
This problem is more common than not and I will show you some things to check to solve this problem.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question