Tag Info

New answers tagged

1

Yes, your analysis and algorithms are correct. But it can be made better by trading off memory for performance IF the amount of possible characters in string is limited (eg. it is not full Unicode). Basically, you can use hash-map to keep count of every character in O(n)*O(1) and then go through the list in O(1) (because the count of all possible characters ...


3

Mathematical definition: Closure is defined for a particular operation over a particular set. Let's say we had a set S and we have 2 elements from S, call them a and b, and we have an operation, call it @ that combines 2 elements of S. Then @ is closed over S if a@b is always in S, no matter which particular elements we picked. So you have to specify ...


2

There's no just 'closure propery', there's a 'closure under operation X'. For instance, integers are closed both under addition and multiplication. Tuples are closed under many operations, one of them being 'element composition', that is, you can use a tuple as an element of another tuple. This particular property obviously, by construction, allows to ...


2

At the risk of repeating the previous solid, deleted answer... Like addition in case of real numbers, what is the operation on which tuple hold closure property? This is an odd question. There are infinitely many operations that work on tuple (or any type for that matter), which will return some type that the operation can be applied to again. It's ...


4

Let's first clear up some of your terminology. Abstraction is a technique for managing complexity of computer systems. It works by establishing a level of complexity on which a person interacts with the system, suppressing the more complex details below the current level. So, for example, writing a method that hides some complex functionality is an ...



Top 50 recent answers are included