What do you want to save?
Add Code snippet
New code examples
-
Python 2022-01-31 05:26:09
python get item from queue
"""put and get items from queue""" >>> from Queue import Queue >>> q = Queue() >>> q.put(1) >>> q.put(2) >>> q.put(3) >>> print list(q.queue) [1, 2, 3] >>> q.get... Add solution -
Other 2022-01-26 09:05:02
Use the linear linked list code to store a randomly generated set of 100 integers. Now write a routine that will rearrange the list in sorted order of these values.
// C program to implement Bubble Sort on singly linked list #include<stdio.h> #include<stdlib.h> /* structure for a node */ struct Node { int data; struct Node *next; }; &nbs... Add solution -
Python 2021-11-16 22:08:12
python convert multidimensional array to one dimensional
# Python convert 2D into 1D array: import itertools x = [['foo'], ['bar', 'baz'], ['quux'], ("tup_1", "tup_2"), {1:"one", 2:"two"}] print list(itertools.chain(*x)) print [element for sub in x for element in sub] #... Add solution -
R 2021-10-24 06:09:08
R convert list of lists into single numeric list
# Set seed so results able to be replicated: set.seed(123) # Make arbitrary List of sub-lists in each index: list.of.lists <- list() for (i in 1:3) { list.of.lists[[i]] <- rnorm(5) } # Print list.of.lists list.of.lists #[[1]] #[1] -0.560475... Add solution -
Python 2021-09-28 03:06:03
python split input to list
input_string = input('Enter elements of a list separated by space ') print("\n") user_list = input_string.split() # print list print('list: ', user_list) # convert each item to int type for i in range(len(user_list)): # convert each item to... Add solution -
Python 2021-09-27 00:24:01
python convert two dimensional list to one dimensional
# Python convert 2D into 1D array: import itertools x = [['foo'], ['bar', 'baz'], ['quux'], ("tup_1", "tup_2"), {1:"one", 2:"two"}] print list(itertools.chain(*x)) print [element for sub in x for element in sub] #... Add solution -
C 2021-09-09 02:12:03
circular linked list in c
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> struct node { int data; int key; struct node *next; }; struct node *head = NULL; struct node *current = NULL; bool isEmpty() { return ... Add solution
Best helpers
Daniel Cook
+5
Czlsws
+5
Shahruz Raad
+5
Horse
+5
Csandreas1
+5
SOUMEN
+5
Vy32
+5
Anugram
+5
ImMathan
+5
Joyo
+5
Huggy Buggy
+5