Solved

Linked Lists

Posted on 2000-04-03
2
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
This article outlines some of the reasons why an email message gets flagged as spam on a recipient's end.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

695 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