instruction_seed stringlengths 0 26.4k | source stringclasses 4
values |
|---|---|
Suggest improvements to the code fragment given below.
x = 25
if x < 20
print("x is less than 20") | codefeedback |
Write an algorithm to reverse a lis
[1,2,3,4,5] | codefeedback |
Write an algorithm to split a given list into two sublists with equal sums
[1, 4, 2, 5, 3] | codefeedback |
Convert the given expression from infix notation to postfix notation.
A + B * (C - D) | codefeedback |
Create a Flask application to send an email notification. | codefeedback |
Add a try-except clause to the given code to catch IndexError exceptions.
list1 = [1, 2, 3]
print(list1[5]) | codefeedback |
Create a class that implements a set data structure. | codefeedback |
Generate a valid RTL(Register Transfer Level) design in Verilog to implement the following Boolean function
F(A,B,C,D) = (A + !B + C + !D)' | codefeedback |
classify the following text into its respective category
Once upon a time, there was a young prince who lived in a castle | codefeedback |
Generate a valid VHDL code for given design
Implement a 4-to-1 multiplexer using the given data ports | codefeedback |
Find the shortest path between two nodes using Dijkstra's algorithm
A graph with 5 nodes and 7 edges | codefeedback |
Rewrite the code snippet to avoid the use of goto statement
start:
x=x+1
if x==10
goto start | codefeedback |
What is the difference between a Node.js callback and a promise? | codefeedback |
Write a function that generates a unique integer ID given a string input. | codefeedback |
You need to rearrange the characters in a given string such that no two same characters are adjacent to each other.
abccab | codefeedback |
You need to build a code editor with basic features like search, replace, undo, and redo. | codefeedback |
You need to build a function that take a given tree and returns a list containing the data stored at each level.
1
/ \
2 3
/ \ /
4 5 6 | codefeedback |
Convert this octal number to a binary number.
Octal number: 77 | codefeedback |
Write a regular expression that will check if a given string contains valid phone numbers.
String: Please contact us at 021-555-3119 or email me at contact@example.com | codefeedback |
Write a C++ statement to delete all the elements from the queue q. | codefeedback |
Write a function in Python to convert a 2D array into a single column array.
arr = [[0, 1, 2],
[3, 4, 5],
[6, 7, 8]] | codefeedback |
Use an API to fetch and print the current weather information of a given city.
City Name: New York | codefeedback |
Write a Python code to fetch the top three trending topics from Twitter. | codefeedback |
Generate a list of project requirements for a web development project. | codefeedback |
Construct a regex to find urls in a given string. | codefeedback |
Construct a SQL query to find out three most expensive items in a product table. | codefeedback |
Given two lists of integers, find all unique pairings where the sum of the pair equals to a given number.
list1 = [1, 2, 3, 4]
list2 = [2, 3, 4, 5]
number = 6 | codefeedback |
Create a program that prints all unique permutations of the given string. | codefeedback |
Calculate the maximum depth of a Binary Search Tree.
TreeNode* root = new TreeNode(3);
root->left = new TreeNode(2);
root->right = new TreeNode(7);
root->left->left = new TreeNode(1);
root->left->right = new TreeNode(5);
root->right->left = new TreeNode(6);
root->right->right = new TreeNode(8); | codefeedback |
Evaluate the expression "7 + 4 * 3 - 6 / 2" with JavaScript. | codefeedback |
Find the area of a triangle whose sides measure a= 4, b= 5 and c= 3. | codefeedback |
Create a parameterized query in Python to find the details of a person. | codefeedback |
Convert pyramid of numbers to a single number.
9
2 3
9 3 5
1 8 6 8 | codefeedback |
Create a web page to display the current weather in your city.
The weather data should be in the form of temperature, humidity, wind speed, and barometric pressure. | codefeedback |
Create a Node.js server that serves a simple "Hello, World!" page. | codefeedback |
Create an Android application for calculating monthly loan payments.
The application should be able to calculate the monthly payments for different loan types (e.g. car, house, etc.). | codefeedback |
Write an C++ algorithm for finding the longest common substring between two strings. | codefeedback |
Create a program for sorting a given array in O(n) time complexity. | codefeedback |
Write a TensorFlow code to build a convolutional neural network to predict the digits from the MNIST dataset. | codefeedback |
Convert this Python list of dictionaries to JSON.
list_of_dictionaries=[
{
"name" : "John",
"age" : 30,
"city" : "New York"
},
{
"name" : "Mike",
"age" : 25,
"city" : "California"
}
] | codefeedback |
Design an algorithm for multiplying two matrices.
A = [[1, 2,],
[3, 4]]
B = [[5, 6],
[7, 8]] | codefeedback |
Can you print out a multiplication table of size 12 by 12? | codefeedback |
Create an algorithm in Java to search for a given value in a sorted array of integers. | codefeedback |
Implement a C# program that reads an array of strings and sorts them in alphabetical order.
Array of Strings: ["banana", "apple", "orange"] | codefeedback |
Find the derivate of this equation: f(x) = x^2 + 5x + 3 | codefeedback |
Write a RegEx to extract text inside tags
<div>This is a test</div> | codefeedback |
Create a permutation of characters in a string.
str = "CAT" | codefeedback |
Implement the Levenshtein distance algorithm in Python. | codefeedback |
given a sentence, classify it into positive or negative sentiment.
I can't wait to get home and relax. | codefeedback |
Given an array of English words, find any word which is an anagram of another word in the same array.
["listen", "pot", "part", "opt", "trap", "silent", "top"] | codefeedback |
Given an array containing words and a string, find the shortest word in the array that is a substring of the string
words = ["apple", "banana", "cat", "dog"], string = "aquickbrownfoxjumpsoverthelazydog" | codefeedback |
Create a PHP script to generate a multiplication table until 10. | codefeedback |
Create a Newsfeed Aggregator Django web application that displays the latest news from different sources. | codefeedback |
Create a React application with a registration form. | codefeedback |
Create a GraphQL API to serve data from a database in Python. | codefeedback |
Write a PHP program to print a Christmas tree on the console. | codefeedback |
Create a Mastermind game in any language of your choice. | codefeedback |
Create a machine learning model to predict the probability of a patient having a certain type of cancer.
features = [Height, Weight, Age, Gender] | codefeedback |
Design a data structure for efficiently finding the closest input to a given input in a set of inputs. | codefeedback |
Implement an algorithm in Python to find the size of a Binary tree. | codefeedback |
Print all powers of 2 less than or equal to n.
n = 10 | codefeedback |
Compute the n-th Fibonacci number. | codefeedback |
Given two arrays of integers, find the common elements.
arr1 = [1, 2, 3, 4, 5]; arr2 = [4, 5, 6, 7, 8] | codefeedback |
Generate a C++ code with a loop from 0 to 20 which prints odd numbers only. | codefeedback |
Reverse a given list of strings.
['first', 'second', 'third'] | codefeedback |
Given an integer array, classify all the elements as even and odd.
[1, 2, 3, 4, 5, 6] | codefeedback |
Develop a code to check whether a number is a palindrome.
Number: 1234321 | codefeedback |
Using React, write a component that displays a table containing the user's profile information. | codefeedback |
How does React.js update a user interface? | codefeedback |
Design a REST API in Python that would return a list of customer information. | codefeedback |
Write a SQL query to list all customers who have purchased items more than twice in the same year. | codefeedback |
Find the greatest common divisor for two integer inputs using the Euclidean Algorithm.
30, 60 | codefeedback |
Calculate the linear regression line for the following data.
X: [1, 2, 3, 4, 5]
Y: [6, 8, 10, 11, 12] | codefeedback |
Explain how a neural network works. | codefeedback |
Summarize the features and differences between Python and Java. | codefeedback |
Create a boolean function in Java to check if a year is a leap year. | codefeedback |
Return a dictionary containing the number of occurrences of each word in the string.
s = "this string should contain 4 occurrences of the word should" | codefeedback |
Design an algorithm to find the median of two sorted arrays. | codefeedback |
Given a linked list, design an algorithm to reverse it. | codefeedback |
Generate a list of 4 random numbers between 0 and 10, without duplicates. | codefeedback |
Create a program to find the closest string to the given string from a list of strings.
string = "text"
strings = ["tens", "tent", "teach", "tewksbury"] | codefeedback |
Implement a function in C++ that takes two strings as parameters and returns the longest common substring between the two.
str1 = "stackoverflow"
str2 = "overburning" | codefeedback |
Write a SQL query to select the records with the highest values for a given column. | codefeedback |
Write a Java method to remove repeated elements from an array. | codefeedback |
Create a code snippet that solves the following equation: 4x + 5y = 20 | codefeedback |
Generate a code to parse an HTML string and extract the body text only.
<html> <body> test text <p> Some more text </p> </body> </html> | codefeedback |
Generate a program to sort the list.
unsorted_list = [3, 5, 1, 0, 9] | codefeedback |
Create an object oriented program to print the Fibonacci sequence. | codefeedback |
Generate a syntax-correct program to calculate the sum of the elements in a given 2D array | codefeedback |
Generate a syntax correct program which reverses a given linked list | codefeedback |
Write a code snippet to display a website's current URL. | codefeedback |
Write a MySQL query to join employees and departments tables and retrieve records which have department_name='Sales and Marketing'. | codefeedback |
Write a REGEX pattern to only match valid JavaScript variable names. | codefeedback |
Refactor this line of code to make it more concise.
tasks = [t for t in tasks if t.completed == False] | codefeedback |
Write code to encrypt a string | codefeedback |
Sort a given list by the second element of each pair
my_list = [(2, 9), (1, 4), (3, 5)] | codefeedback |
Given a matrix, write a program to rotate it by 90 degrees clockwise.
matrix = [[1,2,3],
[4,5,6],
[7,8,9]] | codefeedback |
Parse a JSON string and print all the key-value pairs in alphabetical order.
{
"orange": 4,
"apple": 1,
"banana": 2
} | codefeedback |
Create a function to check the validity of an email address. | codefeedback |
Find the maximum sum of a subarray of size 'k' in a given array.
arr = [1, 4, 2, 10, 23, 3, 1, 0, 20]
k = 4 | codefeedback |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.