SciELO - Scientific Electronic Library Online

 
vol.9 issue18The Schottky diode as attenuator of the Seebeck effect on a Peltier cell for a PID temperature controlModeling the interaction energy of silica nanoparticles prepared in microemulsions author indexsubject indexarticles search
Home Pagealphabetic serial listing  

Services on Demand

Journal

Article

Indicators

Related links

  • On index processCited by Google
  • Have no similar articlesSimilars in SciELO
  • On index processSimilars in Google

Share


Entre Ciencia e Ingeniería

Print version ISSN 1909-8367

Abstract

TREJOS, O. I. Comparison of two algorithms in order to find Pythagorean triples using two different programming paradigms. Entre Ciencia e Ingenieria [online]. 2015, vol.9, n.18, pp.84-94. ISSN 1909-8367.

Abstract In this article we analyze the algorithmic characteristics of two solutions for the problem to find Pythagorean triples in a specific range from 1 to n to a defined value of n as an integer. We also make a comparison between the solution implemented with functional paradigm in Scheme language environment Dr. Racket version 6.1 and the solution implemented with imperative paradigm in C++ language environment Dev C++ version 5.8.0. The comparison of these solutions is made from the perspective of two different programming paradigms. We analyze the pure codification, the logic used in the implementation and the performance and efficiency using the computer timer. Both programs present two formats to show the results in the display. These comparisons not only permit to establish possible relations between the programming computer paradigms (functional and imperative) but also let us to think about a hybrid solution from the best of each solution implemented. Each implementation is absolutely original product of the research and the initiative and experience of the author of this article.

Keywords : algorithm; functional programming; imperative programming cyclic process; recursion; Pythagorean triples.

        · abstract in Spanish     · text in Spanish     · Spanish ( pdf )

 

Creative Commons License All the contents of this journal, except where otherwise noted, is licensed under a Creative Commons Attribution License