любой-язык

What is the difference between shuttle sorting and insert sorting

Some sites say that shuttle sorting is the same as shaker sorting, and other sites show how shuttle sorting works, and the pr ... ts. Can you please explain what the difference is and, if possible, give an example where this difference is clearly visible.

How do I compare the sizes of two boxes?

Two boxes with dimensions (L,B,H) are given. You need to write a beautiful (speed optimization) size comparison function, fun ... f how it can be optimally implemented are interesting. Used in a critical place, you need to optimize the speed of execution.

How to implement the generation of placements without repetitions?

How best to implement the permutate function with the signature (JavaScript) const array = ['a', 'b', 'c']; const k = 2; co ... expected return value: const permutations = [ ['a', 'b'], ['b', 'a'], ['b', 'c'], ['c', 'b'], ['a', 'c'], ['c', 'a'] ];

A uniqueness check in which False!= 0

You need to check JSON for uniqueness. The validation conditions assume that the collection [false, 0] is unique, that is, th ... ly contains both dictionaries and lists. I would like to find a universal and, preferably, non-recursive traversal algorithm.

search for a point on the map by two coordinates and distances to it

I figured out how to find the distance between two points on the map, but I can't figure out how to solve the inverse problem ... d what angle this cosine corresponds to, and how can I get bearing to calculate the coordinates? or did I do something wrong?

Explain about translation and compilation

Languages are divided into interpreted and compiled languages. And what is the difference? Are the commands still translated into bit instructions? Is it even necessary to dig so deep for a web developer?

Automated word translation

For example, there is a link https://translate.yandex.ru/?lang=ru-en&text=текст When you click on it, the word "Text" in ... tion that when you click on this link, ONLY the text itself is answered? Empty HTML page absolutely and text at the top left.

Turing Completeness

As you know, most widely used programming languages (especially imperative ones) are Turing-complete. And some - even relativ ... with their templates. And how is Turing completeness proved/disproved? In itself, this concept looks difficult to formalize.

What language should I start with? [closed]

Closed. It is impossible to give an objective answer to this question . Answers to it are not accepted at the moment. ... thon. But where do I start? And where on the Internet can I get good self-help books? I will be grateful for useful answers!

How to quickly sort 3 items?

I have three elements (array, not array - it doesn't matter). How can I sort them as quickly and compactly as possible? For ... ou do not want to pull dependencies in the program). Please provide a pseudo-code that is simple and simple compact sorting.

Is it possible to wet the object under test?

Yes: Class to test class Message extends Data { protected $text = ''; public function check() { ... ning question. There is no problem with the specific code, this is just an example (it is better to understand the examples)

What programming languages are compiled into an executable file?

Namely, that these languages are for Windows (exe) and Linux (elf). Plus, to work with basic functions (Sockets, cmd (Windows), ...) Except c++

The algorithm of the fastest victory in the math game

A friend of mine suggested that I play a game. This is a turn-based game and for two players. Here are the rules: Both pla ... to me that it is too primitive. There must be a way to win this game in any scenario in the least number of moves. Any ideas?

Optimization of operations for a binary indexed tree (Fenwick tree)

I am doing optimization in one project that is very out of line with the performance requirements. Here, Fenwick trees are wi ... any imperative language. If my reasoning about complexity is wrong, then I would like to know what exactly I am wrong about.

What does a class field that contains an object of this class mean?

Hello! In the code, there is often such a construction (in any c-like language). class One { One instanse; //Вот эта строч ... d each instance already contains an instance of itself? Optional - where and in what book (site) is this clearly described?

Algorithm for placing stickers on a Rubik's cube of any size

Let's say there is a Rubik's cube of arbitrary size NxNxN. At the input, we have the initial position of the block A (Xa, Ya ... nd we also get R (0, 0, 0). That is, again there is no information at all, but the cube is already turned counterclockwise!

Why is optimistic locking so named?

Why, for example, in java optimistic lock is called this way, and not otherwise?

Why are many examples of functions called foo?

I often see in various literature, video tutorials, articles on the Internet, and so on that demonstrative functions and methods are called foo. What does this mean ?