Solved

Linked Lists

Posted on 2000-04-03
2
150 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
Comment Utility
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
Comment Utility
Why don't two people give an answer so that I compare the two to get the best?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
In this step by step tutorial with screenshots, we will show you HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 6.5 (ESXi 6.5). This is important if you need to enable SSH remote access for additional troubleshooting of the ESXi hos…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now