Заметки о трёх парадигмах программирования

Authors

  • Nikolai Shilov

Keywords:

programming paradigms, imperative programming, functional programming, logical programming, memoization, dynamic programming

Abstract

This paper is about programming paradigms, how different paradigms can fertilize each other. In particular the paper discusses a challenging contest programming problem and solves it in three programming paradigms: logic, functional and imperative. It can be considered as a case study of algorithm inversion, since we start with logic algorithm, that answers the question "Is balancing M times sufficient for detecting a single fake in a set of coins?", and finishes with imperative algorithm, that effectively computes the minimal number of balancing that is sufficient for detection the fake. Functional paradigm is used for developing an intermediate functional algorithm that also computes the minimal number of balancing, but inefficiently, while the efficient imperative algorithm is a «lazy memoization» of the functional one.

Downloads

Published

2010-04-30

Issue

Section

Computer science

How to Cite

[1]
“Заметки о трёх парадигмах программирования”, Comput. Tools Educ., no. 2, Apr. 2010, Accessed: Oct. 25, 2026. Available: http://cte.eltech.ru/ojs/index.php/kio/article/view/1213