Questions tagged [cyclic]

119 questions
0
votes
1 answer

Detecting cyclic pairs

Assume a std::set< std::pair >, can somebody suggest an algorithm or approach to check whether there are cyclic pairs? e.g. std::set< std::pair > cyclic = { {'A', 'B'}, {'B', 'C'}, {'C', 'A'} }; std::set< std::pair
user2804578
  • 32
  • 1
  • 4
0
votes
6 answers

Construct a circular loop in python

I want to loop a list over a cycle. ex: I have three elements in the array L = [1,2,3] I want to get the output as L[0],L[1] L[1],L[2] L[2],L[0] Is there a easy way get the slightly different output L[0],L[1] L[1],L[2] L[0],L[2]
0
votes
3 answers

Return to the beginning of an array during a foreach loop in PHP (Cyclic)?

When you reach the end of an array in a PHP foreach loop, is there anyway to just start from the beginning again? I'm building a graph using JS and PHP of a group of different people. I would like to have a different colour for each person on the…
0
votes
1 answer

check if array coordinates neighbour cyclical array point

I have a 3d array with dimensions M x N x L, which defines the values on a cyclical volume (i.e. the M-1'th point is next to the 0th point, if we're zero indexing). If I'm given the coordinates of a point (X, Y, Z), how can I neatly find all the…
tiswas
  • 2,041
  • 7
  • 31
  • 43
0
votes
1 answer

Java snail line layout manager

i am looking for a java custom layout manager that arranges a couple of data (e.g. jlabels) in a way similar to the snail's back line. So far, i have tried to work on the circle layout that i found on the internet to customize it but with no luck..…
kafou
  • 1
  • 1
-1
votes
1 answer

Use C++ to find a Cyclic group with prime order

How can I use C++ to find a cyclic group of prime order? I require the element of this group to be 128 bits. In need to find this kind of group to execute cryptographic operations.
zhen liu
  • 13
  • 1
-1
votes
1 answer

How do you set up a for loop which basically goes around in a cyclic pattern for a set amount of numbers? For example, how to go from 123 to 231to 312

could someone please show me how to approach this type of question as I am revising for my end of semester exams. Write a function cyclical(n) that produces an n ×n pattern in which the numbers 0 to n −1 appear in every row, but where the numbers…
-1
votes
1 answer

How to pass reference of class A to class B in case of cyclic import while keeping type-hinting and auto-completion capabilities in Pycharm

In Python 3.7.2 I have two classes that are referencing each other. I've looked at the question and answers in: Circular (or cyclic) imports in Python and they don't answer the question of how to keep type-hinting and auto-completion capabilities…
RaamEE
  • 3,017
  • 4
  • 33
  • 53
-1
votes
1 answer

cyclic dependency creating bottlenecks for multithreading

There are two classes A & B:- 1) A contains B. A carries out 2 operations on B ... insert(data) into B's map and later replace that data. 2) Along with this A also has a map in which it insert/replaces the data that it feeds to B 3) B after carrying…
Player
  • 21
  • 9
-1
votes
1 answer

Depth-cyclic list

(define depth-count (lambda (l) (let ((visited '()) (counter 0)) (let iter ((l l)) (cond ((pair? l) (if (memq l visited) (set! counter (+ 1 counter)) (begin …
Poody
  • 325
  • 3
  • 13
-1
votes
1 answer

C program to calculate CRC

Goodnight everyone, I´ve been working on this code based on the logic that to obtain a CRC you need to do 2 XOR operations, the first one: result = data ^ generator, then it moves >> bit by bit over the 16 bits and does the XOR over and over again…
Eos
  • 23
  • 1
  • 5
-4
votes
1 answer

Xor and Cyclic shift

Suppose we have this equation c = m ⊕ (m << 6) ⊕ (m << 10) where ⊕ stands for XOR and << for cyclic shift to the left. How can this be written as m in terms of c? What operations must be used? I tried xoring both sides with c << 6 but didnt result…
1 2 3 4 5 6 7
8