Questions tagged [remove-method]
34 questions
0
votes
2 answers
How do I remove characters between /* and */ from a string
I am trying to remove characters of comments(/* */) from the String s, but I am not sure how I extract them, especially, from the second comment.
This is my code:
public String removeComments(String s)
{
String result = "";
int slashFront =…

Rai
- 3
- 1
0
votes
1 answer
free(): double free detected in tcache 2 in PriorityQueue remove method
I am programming a priority queue, and I am getting an error:
free(): double free detected in tcache 2
I know that problem is in the PriorityQueue::Remove(int value) method. The method tries to delete an element by value. This method returns TRUE…

Repkins
- 37
- 9
0
votes
1 answer
SinglyLinkedList remove(int index) method
I have some problems when implementing a remove(int index) method that is supposed to remove an element at a specified index in a list. My first problem is how to shift any subsequent elements to the left and subtract one from their indices. I…

Natalie_94
- 79
- 3
- 12
0
votes
2 answers
How to remove a string from a Binary Search Tree
I am trying to remove a string from a BST and I cannot figure it out. I know how to remove integers but cannot convert my code to remove Nodes that have strings. Here is the code I currently have
/*
* Removes the specified string from the…

Ryan
- 7
- 1
0
votes
1 answer
How to write a remove method with Cyclic Doubly-Linked-List with Generic Nodes in Java
I am implementing a cyclic DoublyLinkedList data structure. Like a singly
linked list, nodes in a doubly linked list have a reference to the next node, but unlike a singly linked list, nodes in a doubly linked list also have a reference to the…

Adan Vivero
- 422
- 12
- 36
0
votes
0 answers
Removing a node from Binary Search Tree (BTS), and successor method
In my new class assignment, one of the classes in my program I have to write is a BinarySearchTree class. There are 2 methods on which I am struggling a bit, and that's the remove method and successor method.
The binary search tree only stores data…

Pengibaby
- 373
- 2
- 11
0
votes
1 answer
Difficulty with analyzer.py, returns KeyError: ';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n'
Here's how my code looks like:
import nltk
class Analyzer():
def __init__(self, positives, negatives):
self.positives = set()
self.negatives = set()
file = open(positives, "r")
for line in file:
…

Ckoh
- 51
- 5
0
votes
1 answer
How to remove an part of values in R
I have got a data frame like this:
ID A B
1 x5.11 2,34
2 x5.57 5,36
3 x6,13 0,45
I would like to remove the 'x' of all values of the column A. How might I best accomplish this in R.
Thanks!

uta
- 11
- 1
0
votes
0 answers
Python .remove issue
Is this a bug of Python?
I define a simple list:
a = ['a', 'b', 'c', 'd']
I copy this list into another variable z:
z = a
I remove one element from the first list:
a.remove('a') which produces ['b', 'c', 'd'] as expected.
But then ask Python to…

Fred
- 1
- 1
0
votes
3 answers
Jquery: click event to remove() image element click on and adjacent image element
This is prob a quite weird or simple error. But it's doing my head in lol. The code below is a click event handler aimed at 2
elements. You click on the one
element classed "undo" - This should remove the
being clicked and also the…

Walter
- 1
- 1
- 3
0
votes
2 answers
Ruby - How to remove a setter on an object
Given a class like this:
class B
class << self
attr_accessor :var
end
end
Suppose I can't modify the original source code of class B. How might I go about removing the setter on the class variable var? I've tried using something…

Markus Orrelly
- 1,669
- 2
- 12
- 9
0
votes
3 answers
How can I remove item (entry from textbox) in listbox
In my form have TextBox1 and ListBox1, buttonAdd, buttonRemove
buttonAdd => OK, I can do it.
buttonRemove: When you delete a section:
- Delete entry from textbox: Check one item in the listbox item should be deleted, if there are clear, if not, the…

user2485423
- 1
- 1
- 3
0
votes
1 answer
Remove method in Red Black Tree
I have problem with the remove method in a RB tree. There is a NullPointerException at x.parent=y.parent. The problem is definitely x=null, and if I use this x in method DeleteFixUp there is NullPointerException too. Where do I have a…

Xwar
- 75
- 1
- 5
0
votes
1 answer
Python Dijkstra: Removing current node from Unvisited error: list.remove(x): x not in list
I would like your help with something that's been bugging me. I really have tried to figure this out on my own, but after several hours I feel thoroughly stuck.
So, I'm new to python (my second language), and I'm writing an implementation of…

Chris
- 71
- 5
-1
votes
1 answer
How can I remove a reversed number from a list number?
I'm trying to remove all reversed numbers from a list but i can't remove some of them, for example I have defined
def reversed(num):
reversed_num=0
while num != 0:
digit = num % 10
reversed_num = reversed_num * 10 + digit
…

endiku
- 1