comp.lang.ada
 help / color / mirror / Atom feed
* Recursion
@ 1997-10-06  0:00 Dirien B. Perez
  1997-10-06  0:00 ` Recursion Larry Coon
  1997-10-09  0:00 ` Recursion Michael F Brenner
  0 siblings, 2 replies; 3+ messages in thread
From: Dirien B. Perez @ 1997-10-06  0:00 UTC (permalink / raw)



Hi I am having some problems with recursion I have the iterative 
version of a function that will calculate the sum of the elements is a
linked list:

	function sum(list:cell_ptr) return integer is
	local:cell_ptr:=list;
	s:integer:=0;
	begin
		while local /= null loop	
		s:=s+local.value;
		local:=local.next
		end loop;
	return s;
	end sum;
I need help creating the recursion version. Also I need to createa
recursive definition of the set of all positive numbers containing only
the digits 3,5 and 9.

I appreciate any help that I can get...... and thank you in advance.
future ada programmer..




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-10-09  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-06  0:00 Recursion Dirien B. Perez
1997-10-06  0:00 ` Recursion Larry Coon
1997-10-09  0:00 ` Recursion Michael F Brenner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox