Questions tagged [insertion]

place into or between other items in an enumeration

578 questions
-2
votes
1 answer

in which scenario we did insertion in Big-O(1) when array is full?

using hash-tables if array is completely filled than what is the best possible methode/scenario that we can do insertion in Big-O(1)... explain me in detail.
-2
votes
1 answer

Binary Tree Insertion Not Working

I have the following code for inserting nodes into a tree. The problem is that the code is not working, there is no compilation error, but the output isn't proper. The code is as follows: #include struct node { int data; node…
praxmon
  • 5,009
  • 22
  • 74
  • 121
-2
votes
1 answer

Insertion sort program, no output

This is the simplest insertion sort program. Unfortunately, it doesn't provide an outcome: it does prompt the user for the size of the array and for the list of numbers, but it doesn't do the sort. I would be grateful for your help! /** Insertion…
Ducol
  • 175
  • 1
  • 11
-2
votes
1 answer

Sorted Linked list not working properly in C

Completely new to C, im trying to make a linked list in C that sorts a pre existing char array alphabetically. Each char is assigned an index. So the listInsert function should insert each string into the linked list and sort them alphabetically, so…
-2
votes
1 answer

Insert number to a list

I have an ordered dictionary like following: source =([('a',[1,2,3,4,5,6,7,11,13,17]),('b',[1,2,3,12])]) I want to calculate the length of each key's value first, then calculate the sqrt of it, say it is L. Insert L to the positions which can be…
xlk3099
  • 15
  • 1
  • 3
-2
votes
1 answer

INSERT INTO mysql database not working

I am trying to do something really simple here. All I want to do is to insert information in MySQL Here is the code below for the form.
Feek
  • 9
  • 5
-3
votes
2 answers

Linked List insertion using for loop in separate function

I am learning how to program in C++, and have looked at linked lists. I have found many code snippets to get me started. The code I am playing with is from studytonight. I understand how to insert nodes into a list. But what if I want to create a…
-3
votes
2 answers

How to insert an element starting the iteration from the beginning of the array in c?

I have seen insertion of element in array starting iteration from the rear end. But i wonder if it is possible to insert from the front
krishnaacharyaa
  • 14,953
  • 4
  • 49
  • 88
-3
votes
2 answers

C error: expression must be a modifiable lvalue

I get this error in C: expression must be a modifiable lvalue void bfInsertion(BloomFilter* bloomFilter,const char* elem,int elemLen) { int i = 1; while (i <= elem) { elem[i] = 1; i += 1; } return…
Sara Briccoli
  • 141
  • 3
  • 11
-3
votes
1 answer

insertion sort gives out the same array

hi im creating a tiny lotto program and the program needs to sort out the first 6 numbers of the dictionary using insertion sort and the last 2 using selection sort i have done the code and complied it but it give me the below set of result, the…
lokki
  • 1
-3
votes
2 answers

Insertion Sort Algorithm, using a small array

just wanted to know if the below is correct. I am trying to solve this using the insertion sort algorithm. I have tried to attempt the below array and have come up with these answers. Please could you let me know if this is correct, and if i have…
Abdul
  • 15
  • 6
-3
votes
1 answer

Python: insert value to matrix

I have a Problem with the simple insertion into a matrix in python: (I am not very python experienced) matrix = numpy.zeros(shape=(len(10), len(10)), dtype=int) Now I want to insert specific values to the matrix index, e.g. at line 1, column 1. How…
ThinkPad
  • 9
  • 1
  • 1
  • 2
-3
votes
4 answers

How to insert and display arraylist in java program?

This is the output of the program: Enter your last name: Dela Cruz Enter your first name: Juan Enter your course: BSCS Enter your year: 4th Year Display Array List [0] - Dela Cruz | Juan | BSCS | 4th Year Add More (y/n): if yes it will add more…
xdiver
  • 111
  • 1
  • 8
-4
votes
1 answer

This is my c programming code using linked list. I have some errors which I've been trying to figure out for an hour

Create a program to store a song playlist using linked-list. The program should be able to: Insert a new song at the front of the playlist Insert a new song at the back of the playlist Insert a new song in between the playlist Delete any song in…
sss
  • 1
  • 2
-4
votes
1 answer

What's wrong with my code? It shows an unwanted result

#include #define ll unsigned long long int using namespace std; ll solve(ll arr[], ll n, ll b, ll x, ll pos) { if(n == b) return n; ll idx = pos - 1; for(ll i = n -1; i >= idx; --i) { arr[i + 1] = arr[i]; } …
rocz you
  • 13
  • 3
1 2 3
38
39