списки

Lock-free ordered list

There is a method for inserting an item into an ordered list. Will it be correct for lock-free? template< typename _Pred & ... ck. P. s.: strange all the same regulations on the Hash Code about comments, why can't you control their number individually?

The Josephus problem using a cyclic list

Linked lists in C++ - there is an example here, but it is a little unclear. struct node { int item; node *next; node(int x, node *t) { item = x; next = t; } };

Adding an item to the end of a doubly linked list

Hello, I didn't fully understand how to add items to a doubly linked list. Here I added to the top of the list. How do I add ... cture of this type. struct Students{ string surname; int number; float average_point; string study; Students *Next, *Prev;

Removing an item from the beginning of a singly linked C++list

I wrote a program for working with a singly linked list. Each element has a name (name) and content (content), which is fille ... endl; } else continue; _getch(); } while(ckey != '4'); system("pause"); return 0; }

Sorting a singly linked list by inserts

I implement sorting the list by inserts. I spied an example of such sorting here and changed it to fit my list. Here is the s ... using typedef and the name The structures are at the end, but I haven't read K&R to the point where it's being told yet.

A singly linked list implemented on an array (C++)

Hello, I was given a task to implement a singly linked list on an array. I don't quite understand what is required of me. I c ... ructures struct list { string val = " "; list* next; } What should the implementation look like on an array?

list of lists

Good day to all, I need a little help partly related to questions number 748904. the problem is, first I will demonstrate the ... but the following occur creates a new identical list but not as a new one with 49 elements that is, the tokov construction:

Block sorting

The essence of the algorithm is that we distribute the numbers from the interval [0; 1) into lists, sort each such small list ... st{ double data; struct list *next; }; However, this did not help. And after the sorting array contains only zeros.

A circular list to represent people

I just started sorting through the lists. One point at point blank range I don't understand. In Sedgwick's book Algorithms in ... he next item in the list is assigned a value that is stored after the next item in the list: (*x).next = (*(*x).next)).next;

Haskell functions on sample lists

The task description is below. In my opinion, only process1 is suitable, but this answer is incorrect. What other functions a ... = [] process4 f (t1 : t2 : (x,y,z) : ts) = f y : process4 f ts process4 f ts = []

Fast list subtraction

The lists A and B are known. You need to get the list C = A – B. There is the following implementation: for i in A: if ... and higher), the method naturally works very slowly. Is it possible to implement such a search faster? If so, how exactly?

Outputs in the compiler instead of the number nan

Created a list of numbers 3 5 1 9 struct Data { int a; }; struct List { Data d; List *next; }; ... >d.a; ++count; } cout << "Average = " << double(sum)/count << endl; return 0; } Why?

Output words from a list and sets in python

How do I get words from a list and a set in Python without parentheses? For example, from the list ['end','nend'], you need ... ckets, so that there are just 2 words: end nend And from the set, the same thing. How do I output data in multiple rows?

Automatically add notes (captions) to a bar chart

Hello, forumchane. I'm currently working with lists in Python. It turned out to build a diagram, referring to data from two ... nd-Moscow, etc. The function should perform this operation automatically, simply referring to the list. Thank you in advance.

Create a list of numbers from a string with numbers separated by a space

There is a string: '45 30 55 20 80 20'. You need to create an array of the numbers included in this string: [45, ... ] else: w.append(int(e)) e='' print(w) The problem is that he does not see the last 20, please help

How to add a string to a Python list

When I want to add the string "Hello world!"{[4] to the list lis in Python]}, Python adds a string very strangely, and the ... ', 'w', 'o', 'r', 'l', 'd', '!'] How to fix it, and add it to the line so that the list looks like this: ['Hello world!']

Converting a string of numbers to a list of those numbers

How do I convert a string of numbers object to a list of numbers object so that these numbers are separated by commas? Given string: '2468375169' Result: [2,4,6,8,3,7,5,1,6,9]

List-by-list and Python comparison

There is such a problem at the output of the function outputs the result. You need to filter the results somehow, you need to ... 3], [4, 8, 6], [2, 5, 7, 8], [1, 5, 7, 8], [6, 3, 7, 8], [4, 6, 8], [3, 7, 4], [1, 5, 6, 7, 4], [2, 8, 1, 6, 4], [8, 6, 4]]

Entering a rectangular matrix with no known dimension in Python

Task: Write a program whose input is a rectangular matrix in the form of a sequence of strings ending with a string containin ... s possible and without unnecessary crutches Sample input: 9 5 3 0 7 -1 -5 2 9 End Sample output: 3 21 22 10 6 19 20 16 -1