Skip to content

problem with the size when trying to delete items  #1

Open
@simohamedhdafa

Description

@simohamedhdafa

`package com.deepak.data.structures.LinkedList;

public class theGame {

public static void main(String[] args) {
	
	CircularLinkedList<Integer> g = new CircularLinkedList<Integer>();
	int [] t = {15, 14, -12, 7, -7, 20, 13, 1, -15, -14, 12, 71, -17, -20, 103, 10};
	for(int e : t) g.insertAtTail(e);
	g.display();
	int i = 0; 
	while(g.size()>1) g.deleteFromPosition((i++)%g.size());
	System.out.println("Winner:");
	g.display();
}

}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions