place into or between other items in an enumeration
Questions tagged [insertion]
578 questions
-1
votes
1 answer
I am trying to insert value in linked list but in output it is showing only first insertion
In this I am trying to insert values in empty linked list initially and then adding element after that .
function insert is inserting element in linked list .
display function is displaying linked list .
so i am getting output as first insertion…
-1
votes
2 answers
binary search on array giving wrong index on java
I'm writing a code that does not have to import java Arrays, and that inserts, deletes, and searches a series of values; but the output prints out that it does not find the values on the list when the binSearch() method is called. I have already…

goldenstarfish
- 3
- 3
-1
votes
4 answers
Python sorted list insertion
I need help for an exercise in python where I have to fill a preexistent code.
The function take an integer and a sorted list, it inserts the value a and then returns the new list, I have to replace the dots by the correct answer
It looks like this…

Soomom
- 11
- 3
-1
votes
1 answer
Weird behaviour of bisect.insort in Python 3
Python 3.8.2 on a linux box, If I create a list and just use insort over it, I get the expected result; on the other hand if I reverse the order of the elements in the container before calling insort this happens
>>> a = list(range(10))
>>> a
[0, 1,…

xelp
- 47
- 4
-1
votes
1 answer
I want to create a shared ptr vector of different objects
You have 2 classes Cats and Dogs and need to create a vector of shared pointers which stores the data from those 2 classes. Hints: polymorphism and keep in mind that classes can have similar fields.
So this is what I've done until now. I want to…

xyzmtx
- 1
- 1
-1
votes
1 answer
insert json file data to sql table using sparksql
Im trying to insert json file data to sql table using sparksql
my sample json file example :
{
"id": "value_string",
"aggregate_id": "value_string",
"type": "value_string",
"timestamp": "value_string",
"data": {
…

shaikshare
- 1
- 4
-1
votes
1 answer
Why am I not getting any output, for my code on insertion in linked list?
I am trying to create a singly linked list by inserting nodes at end, and despite having no errors I am unable to print my linked list. Please help me debug my code.
I tried online compiler on codechef and it shows SIGSEGV Runtime error. What is…

ANOUSHKA TRIVEDI
- 13
- 1
-1
votes
1 answer
Does MS SQL allow to use multiple queries for different columns in INSERT statement?
Is it possible to insert values using multiple queries for different columns?
MS SQL allows to write,
INSERT INTO TABLE1(COL1)
SELECT COL1 FROM TABLE2
But what if I want to insert one data from one table, and another data from another table? Does…
-1
votes
1 answer
C++ - Insertion in a Linked List without using a node's constructor. Is it possible?
I'm working on implementing a Templated Linked List in C++ that will be used to simulate a train moving through numerous stops where traincars are both added and removed. Traincar is its own class and each object is supposed to be given a unique ID…

Fayemrost
- 51
- 1
- 7
-1
votes
1 answer
TypeError: input() takes 0 positional arguments but 1 was given
I am writing a Python program to measure the time complexity of insertion sort. However, I got the above mentioned error on line number 6. This error also occurs during other{ int(inputs) }. Any help would be great,thanks. My code is:
import…

ABHISHEK PARMAR
- 37
- 1
- 7
-1
votes
3 answers
Insertion into linked list
I wrote a program that inserts nodes into a linked list in descending order.But whenever I test my code with numbers 12,14,13,19,7 in this order.Whenever I entered 7 I took 7 is already in the list.But as easily seen 7 is not in the list before I…

virtue
- 583
- 2
- 8
- 11
-1
votes
2 answers
C insertion sort stuck in while loop
I'm writing a simple program to sort a small array but when I run my code for insertion sort the program just runs forever.
It's probably a problem with the while loop. I ran through the program on paper and looked over some other people's code but…
-1
votes
2 answers
Linked List Insertion in C using double pointer
Hi I'm a newbie learning Linked List, I created this sample program ,but it is not populating all the list, only last two are getting populated (or these overwriting the first linked elements)
Can someone please help me what is causing the issue…

Hariprasad C R
- 67
- 2
- 7
-1
votes
1 answer
To display a record having multiple values in a table in postgres
Desired output-
Emp_name|Hobbies|age|DOB
______________________________
LOPEZ |Football , Swimming , Fishing |19| 1999-05-11
Here in the question, the Hobbies column is having multiple records with comma separate, BUT I want in a SINGLE line…

Subhashis Dey
- 13
- 5
-1
votes
1 answer
difficulty inserting into binary search tree
I am currently learning C++ and have been researching BST. I took upon myself a task within a workbook but have been struggling to finish the implementation.
I am not allowed to change the header file or any of the function definitions but I am…

D.Smith
- 3
- 1