instruction_seed
stringlengths
0
26.4k
source
stringclasses
4 values
Print the nth element from a spin lock sequence using only O(1) space.
codefeedback
Merge two sorted linked lists and return it as a new list.
codefeedback
Construct a regex pattern to match a valid IP address
codefeedback
Write an algorithm to find the area of a triangle
codefeedback
Create a neural network to classify types of dogs
codefeedback
Develop a program to encrypt a text
codefeedback
Develop a web page which takes user inputs and validates them
codefeedback
Suggest a code to add the values of all odd numbers in an array. arr = [1, 2, 3, 4, 5, 6]
codefeedback
Print the symmetric difference of two sets. set1 = {1, 2, 3, 4, 5}, set2 = {1, 3, 5, 7, 9}
codefeedback
Replace NaN values in the given dataframe with a string. Stored in the form of a Pandas dataframe. 0 1 2 3 a NaN b NaN 4 NaN 5 6
codefeedback
Develop an algorithm that checks for balanced parentheses in a given string.
codefeedback
Design a machine learning model to classify an article as either a sports article or a food article.
codefeedback
Design a neural network model to detect the sentiment of a given sentence.
codefeedback
Design a data structure to store a list of courses with their corresponding details.
codefeedback
Write a code snippet to compute the average of a set of integers. [3, 7, 11, 15]
codefeedback
Create a Java program to determine whether a given string is a palindrome. A palindrome is a string which reads the same forwards and backwards.
codefeedback
Write a JavaScript function to generate a random string of 8 characters using lowercase alphabets and digits.
codefeedback
Create an algorithm for finding the least common multiple of two numbers.
codefeedback
Construct a for loop in Java for iterating through an array.
codefeedback
Create a for loop to output the square roots of the numbers between 0 and 10 using the math library.
codefeedback
Construct a loop that prints the characters of the given string in reverse order. string = 'Hello World'
codefeedback
Edit this line of code to make it work according to our requirements. print("Hello",[1,2,3],sep='|')
codefeedback
Write an assembly code to perform the task of incrementing a memory block by 8.
codefeedback
Write some Java code to fill in an array of size n with all consecutive numbers from 1 to n.
codefeedback
Generate a Python Fibonacci sequence of length n n = 7
codefeedback
Provide a syntactically correct C++ function that takes a number and returns a string representation of the number.
codefeedback
Write a code to find the maximum value in a numeric array using recursion. array = [1, -2, 3, -4, 5]
codefeedback
Design a Node.js program to send a push notification to users when the deadline of a task is reached.
codefeedback
Add a function to implement a basic calculator in C++.
codefeedback
Construct a decision tree to classify a fruit as mango or apple based on its color and texture.
codefeedback
Write a React class conmponent to render a greeting.
codefeedback
Create a function to decrypt an encrypted string.
codefeedback
Given two sorted arrays, find elements that exist in both arrays. arr1 = [1, 2, 5, 8, 9, 10] arr2 = [2, 5, 6, 9]
codefeedback
Write CSS code to position a block at the top centre of the page.
codefeedback
Reverse a given array's elements and print the resulting array. arr = [1, 2, 3, 4, 5]
codefeedback
Determine the time complexity of the code given below as a function of n. def foo(A, n): if n == 1: return A[0] else: return foo(A, n - 1) + A[n - 1]
codefeedback
Create code that given two linked lists, determine if they intersect Two linked lists: list1 = [3, 7, 8, 10] and list2 = [99, 1, 8, 10]
codefeedback
Create code that, given a string, returns the longest permutation of the same character str = "abcccdef"
codefeedback
Create code that given two binary search trees, determine if they are identical Two Binary Search Trees: Tree1 and Tree2
codefeedback
Create a function that will add two numbers (represented as linked lists) Linked lists: list1 = [2, 4, 3] and list2 = [5, 6, 4]
codefeedback
Create a user interface for a customer order system.
codefeedback
Make a REST API call to get the latest version of Python.
codefeedback
Get the top ten most used words within a string.
codefeedback
Construct a SQL query to find all clients with a given email address. The email address is "test@example.com"
codefeedback
Construct a valid and optimized MySQL query to get the user details of all users who are younger than 24 and have subscribed more than 10 times.
codefeedback
Generate a gradient descent algorithm to optimize a cost function.
codefeedback
Implement the merge sort algorithm to sort a given array ascending. given_array = [7,9,3,8,1]
codefeedback
Write a code to create a web server for a given web page.
codefeedback
Modify the following code to kill a thread after 10 seconds. import threading from time import sleep def worker(): try: while True: print("Thread") sleep(1) threads = [] for x in range(40): t = threading.Thread(target=worker) threads.append(t) t.start()
codefeedback
Change the following code to implement the Observer Design Pattern in Python. class Publisher: def __init__(self): self.observers = [] def add(self, observer): if observer not in self.observers: self.observers.append(observer) else: print('Failed to add:...
codefeedback
Generate a random password of 16 characters that includes a mix of alphanumeric characters and punctuation.
codefeedback
Convert a list of numbers to a 5x5 matrix. given_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
codefeedback
Write a JavaScript function to compare two strings without using any built-in functions.
codefeedback
Create a program which finds patterns in a stream of numbers and prints out the start of the pattern. 87, 88, 89, 87, 88, 89, 87, 88, 89
codefeedback
Construct a for loop in Python to find the sum of all the the numbers between 15 and 30 (inclusive).
codefeedback
Design a regex pattern to check if a given string is a valid URL or not.
codefeedback
Create a Java program that removes duplicate elements from an array. int arr[] = {12, 11, 12, 11, 13, 11};
codefeedback
Implement a k-nearest neighbors algorithm to predict point labels.
codefeedback
Create a function which takes two parameters and returns true if the second parameter is a power of the first parameter. x = 16 y = 4
codefeedback
Design a fourth-order Butterworth low-pass filter.
codefeedback
Initialize a 2D array with `0`s.
codefeedback
In a given list, replace the even numbers by their square. [1, 2, 3, 4, 5, 6]
codefeedback
how to implement a recursive function for computing Fibonacci numbers? max_num = 5
codefeedback
Translate the provided sentence into Pig Latin. The cat jumped over the box.
codefeedback
Create a database schema for managing authentication users.
codefeedback
Write a function to implement heap sort in JavaScript.
codefeedback
Write a JavaScript program to find the remainder when two given numbers are divided. 9 and 5
codefeedback
Write a code to find control characters such as carriage returns inside a given string 'This is a string\r\nwith some control characters'
codefeedback
Generate three different sorting algorithms for a list of integers.
codefeedback
Write a Ruby code to convert a double-linked list to a single-linked list.
codefeedback
Given a valid XML string, write an XPath query to retrieve all the elements <?xml version="1.0"?> <root> <child name="child1" /> <child name="child2"> <subchild>subchild</subchild> </child> <child name="child3" /> </root>
codefeedback
Given a string, the task is to output a new string with all repeating continuous characters collapsed to a single character. aabbccddcc
codefeedback
Create an API Request to send a request with a body in JSON format Endpoint: https://example.com/orders <noinput>
codefeedback
Transform an array of objects using JavaScript Array: [{name: "John", age: 21}, {name: "Mary", age: 18}, {name: "Steve", age: 24}]
codefeedback
Write a TensorFlow program to construct a basic neural network
codefeedback
Write a C# program to take a given number and print it in words. int n = 1234
codefeedback
Find the square root of 961 using JavaScript.
codefeedback
Write a Python function to calculate the sum of all items in a given dictionary with integer values. dict = {'a': 5, 'b': 10, 'c': 3}
codefeedback
Use a regex expression to find all the words that begin with a "t" and end with an "e" in the following sentence. sentence = "The dark night was quiet and still"
codefeedback
How would you limit the output of a SQL query to the first 10 rows?
codefeedback
Write a neural network in Keras that can distinguish between a cat and a dog.
codefeedback
Create a Kendo-UI application to display an interactive grid with the following options: sorting, pagination, and search filter. <no-input>
codefeedback
Write code in Swift to print the Fibonacci Sequence to the first 20 numbers
codefeedback
Find the area of the following circle Radius: 8 cm
codefeedback
How would you set up a database table to store medical records
codefeedback
Write a code that takes a number and prints it out in words. 25
codefeedback
Write a code that takes two lists and find the longest common starting substring list1 = ['cat', 'car', 'camel'] list2 = ['carry', 'cap', 'caterpillar']
codefeedback
Identify common elements between two given lists list1 = [1, 2, 3, 4, 5] list2 = [2, 4, 6, 8, 10]
codefeedback
Create a class in Java with private variables, getter and setter method, and constructor.
codefeedback
Design a function to select the nth smallest element from an array. int[] arr = {11, -2, 4, 9, -5, 7}
codefeedback
Write a code to print all prime numbers up to 1000.
codefeedback
Describe how multithreading works in Java.
codefeedback
Convert a given expression to the postfix notation. (A + B) * (C - D)
codefeedback
Create an artificial neural network to predict the stock prices.
codefeedback
Write a Java program for sorting a given list of numbers in descending order. unsortedList = [7, 6, 5, 4, 3, 2, 1]
codefeedback
Construct a SQL query to delete all the records from a table named 'friends' where the first name is "John".
codefeedback
Write a C++ program for sorting a given list of numbers using bubble sort algorithm. unsortedList = [7, 6, 5, 4, 3, 2, 1]
codefeedback
Create an array of size ten with every even slot filled with the value 0 and every odd slot filled with the value 1.
codefeedback
Describe how to access the fifth element in an associative array in PHP.
codefeedback
Create a Java method that takes a decimal number as an argument and returns its binary equivalent.
codefeedback