circular-list Questions

6

Solved

I want to use a circular list. Short of implementing my own (like this person did) what are my options? Specifically what I want to do is iterate over a list of objects. When my iterator reaches...
Fichtean asked 3/6, 2009 at 21:57

4

I am working using a visual programming environment for musical composition based on CL . I am trying to create a function that when given say 3 elements (1 2 3) will return 1, 2, 3, 1, 2, 3 etc., ...
Bouchard asked 21/5, 2013 at 19:54

4

Solved

I would like to create a circular/cyclic linked list where the tail of the list would point back to the head of the list. So can I use java.util.LinkedList and modify the tail node after creation o...
Stead asked 18/9, 2010 at 15:5

5

Solved

I know how to create the Link and LinearLinkedList classes, but I just cannot for the life of me figure out how to modify them into a creating circularlinkedlist. I have already read the answer to...
Impersonality asked 4/4, 2015 at 8:4

5

Solved

I'm trying to make a circular singly linked list. I'd like to be able to modify my code for a singly liked list but I'm have some trouble. For my linked list I have: class Link (object): def __i...
Bush asked 27/3, 2011 at 18:57

4

Solved

Is there a standard function in Common Lisp that can check against improper lists (i.e. circular and dotted lists) without signaling an error? list-length can check against circular lists (it retur...
Fogged asked 16/2, 2020 at 11:13

2

Solved

Suppose I have a list like this: my_list = [A, B, C, D, E, F, G] Actually, I use my list like a cycle. This means that after G there is A, and before A, there is G. I want to know what is the s...
Agrology asked 27/6, 2015 at 21:7

5

Solved

So if I have a list a and append a to it, I will get a list that contains it own reference. >>> a = [1,2] >>> a.append(a) >>> a [1, 2, [...]] >>> a[-1][-1][-1] ...
Adelleadelpho asked 14/11, 2019 at 17:51

3

Solved

Scenario: For a list that have 3 elements: [A, B, C] You can circular access it as many times as you want. And there is an additional counting function records access count of each element. For ex...
Adria asked 4/4, 2014 at 17:33

10

Solved

Why exactly do we need a "Circular Linked List" (singly or doubly) data structure? What problem does it solve that is evident with simple Linked Lists (singly or doubly)?
Appellant asked 28/8, 2010 at 6:48

5

Solved

I want a simple yet efficient circular buffer/queue. If I use std::vector, I have to do this: if ( v.size() >= limit ) { std::vector<int> it = v.begin(); v.insert( it, data ); v.erase(...
Tardif asked 1/3, 2012 at 13:3

2

I have a list of lists which contains the lower and upper limit of sets of angles something like [[1,22],[2,24]...[359,15],[360,21]] 360 elements in total Now I want to check for each angle fr...
Sartin asked 9/2, 2017 at 10:3

5

Solved

So my program has a need of a type of circular ArrayList. Only circular thing about it has to be the get(int index) method, this is the original: /** * Returns the element at the specified posi...
Heavierthanair asked 6/9, 2013 at 14:8

4

Solved

I'm trying to make a function that will always return me a pre-fixed number of elements from an array which will be larger than the pre-fixed number: def getElements(i,arr,size=10): return cyclic ...
Hekker asked 16/9, 2016 at 5:43

2

I am writing a small strategic game, but I have a problem with implementing a circular linked list. The game involves several people taking actions one by one and round by round until the game end...
Vharat asked 13/7, 2016 at 14:0

1

What is the difference between a Ring Buffer and a Circular Linked List? What purpose does Ring Buffer serve that Circular Linked List cannot or vice versa?
Crumley asked 20/8, 2015 at 4:44

1

Solved

Its very common where I come across some list of elements xs and want to do something to do something with every Nth element. The simplest example would be the Sieve or Erastothenes, where you want...
Eastman asked 25/9, 2014 at 13:53

3

Solved

Referencing @dfeuer's answer to this question: Least expensive way to construct cyclic list in Haskell, which says that using cyclic lists 'defeats' the garbage collector as it has to keep everythi...
Jinajingle asked 26/8, 2014 at 5:7

1

Solved

So if I want to construct a circular list of n 0's and 1 1, which of the following ways is better/cheaper? And is there an even better/cheaper way? Taking into account that n is an Integer and may ...
Payload asked 19/8, 2014 at 2:17

2

Solved

I have data that is arranged in a ring structure (or circular buffer), that is it can be expressed as sequences that cycle: ...-1-2-3-4-5-1-2-3-.... See this picture to get an idea of a 5-part ring...
Concubinage asked 30/7, 2014 at 6:35

4

Solved

Here is my attempt: case class A(val a: A, val b: Int){ override def toString() = b.toString } lazy val x: A = A(y, 0) lazy val y: A = A(z, 1) lazy val z: A = A(x, 2) The problem comes when tr...
Showery asked 5/2, 2014 at 13:53

2

I'm interested in iterating in a list in such a way that I can start at any position and iterate through the whole list by going up to the end, and then looping back to the beginning and iterating ...
Bilateral asked 25/10, 2013 at 23:36

1

Solved

We have been given homework from lisp where I need to use "cyclic" list (I don't know what is the right naming for this). By "cyclic" list, I mean list, where cdr of the last one cons points ...
Rearm asked 20/3, 2013 at 23:13

2

valgrind tells me that I have XX bytes in XX blocks that are definitely lost record blah blah and the source is in malloc, however, I think it's because I am not freeing up enough memory for mallo...
Amii asked 12/11, 2012 at 12:34

2

Solved

This is an assignment. I have to create a circular linked list and remove every third number in the list. When my program reaches the end of the list it should go back to the head and continue the ...
Horthy asked 9/9, 2012 at 11:58

© 2022 - 2025 — McMap. All rights reserved.