?
Solved

Linked Lists

Posted on 2000-04-03
2
Medium Priority
?
167 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 300 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

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
What's worse than having your data encrypted by ransomware? Getting attacked by a so-called "wiper," which simply destroys the data and offers you no hope of ever seeing it again.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

777 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