Infinite Integer Intervals #25
Labels
Fundamentals
Topic - OOP Fundamentals like Polymorphism, Inheritance, Encapsulation Abstraction etc
Medium
Difficulty Level - Medium
Related Problems
#24 is prerequisite of this problem. Please do not read this problem before attempting that one.
Overview
We discussed finite intervals in #24. Now is the time to implement infinite intervals.
[−∞,b]
contains all numbers less than or equal to b.[−∞,b[
contains all numbers less than b.[a,+∞]
contains all numbers greater than or equal to a.]a,+∞]
contains all numbers greater than a.Examples
[−∞,5]
contains 2, 3, 5, -10 and -345.]2,+∞]
does not contain 2, contains 3, 5 and 1 million.Task
Implement Infinite Integer Intervals
Note
[−∞,b]
and]−∞,b]
are two different intervals. But that is not applicable for integers in a programming language which is finite.Source
Reminders
The text was updated successfully, but these errors were encountered: