instruction_seed stringlengths 0 26.4k | source stringclasses 4
values |
|---|---|
Using C++, write a program to sort an array of strings alphabetically.
["Hello", "World", "This", "Is", "A", "Test"] | codefeedback |
Write a code to get the current US Dollar to Euro exchange rate from the European Central Bank. | codefeedback |
Create a function that given two strings, returns a new string with the characters of the two strings alternating.
('abcd', 'efgh') | codefeedback |
Classify the types of sentences in the given text.
The quick brown fox jumped over the lazy dog. She jumped happily. | codefeedback |
Solve this math problem using Python code.
Problem: Find the 3 terms in an arithmetic progression whose sum is 42 and the common difference is 5. | codefeedback |
Describe the process of Gradient Descent algorithm. | codefeedback |
Write a React component to render a table with 4 columns and 5 rows. | codefeedback |
Write a regular expression to check if a string an upper case letter followed by at least 4 digits. | codefeedback |
Write an SQL query to get the name and date of birth of all the people born in the year 1975. | codefeedback |
Calculate the probability of drawing four aces from a standard deck of cards. | codefeedback |
Implement a Bubble Sort algorithm.
list = [10, 5, 9, 25, 1] | codefeedback |
Debug this Python code and explain why it was not running.
def string_split(string, n):
words = string.split(" ")
for x in words[:n]:
print(" ".join(words[:x])) | codefeedback |
Write a function in Python to compress a given string.
aabcccccaaa | codefeedback |
Generate an array in Python of size 10 filled with Random numbers between 1 to 100. | codefeedback |
Rewrite this function using a recursive algorithm.
def factorial(n):
result = 1
for i in range(1, n+1):
result *= i
return result | codefeedback |
Write a code to implement an LRU (Least Recently Used) cache. | codefeedback |
Implement a method to sort a list of numbers using the quick sort algorithm.
[10, 3, 9, -2, 8, 7] | codefeedback |
Design a function to remove all duplicate words from a sentence.
"This is this is a sentence with with repeats repeats" | codefeedback |
Write a function to classify a news article by its tone. | codefeedback |
Implement a stack data structure using linked lists. | codefeedback |
Print the first 10 Fibonacci numbers using a loop. | codefeedback |
Write a code to multiply two matrices, assuming the two matrices can be multiplied.
A = [[1, 2], [3, 4]]
B = [[5, 6], [7, 8]] | codefeedback |
Write a function that sorts its arguments in descending order.
nums = [4, 8, 10, 3, 5] | codefeedback |
Create an algorithm to encourage work balance and productivity in remote work. | codefeedback |
Create a SQL query to find the top 5 movies with highest ratings in a database. | codefeedback |
Create an algorithm to detect plagiarized text. | codefeedback |
Write an SQL query to select one row from a table where two conditions are met.
Table: ‘products’
Condition 1: category is ‘clothing’
Condition 2: rating is greater than 3 | codefeedback |
Write a function to concatenate two strings without using the concatenation operator "+". | codefeedback |
Create a function that converts any number to its hexadecimal representation | codefeedback |
Generate 5 random numbers between 0 and 9 using JavaScript. | codefeedback |
You need add two numbers without using '+' operator.
2 and 3 | codefeedback |
Create a RegEx pattern to match any sequences of characters that contains an "a". | codefeedback |
Modify the code to make an HTTP request to a given URL.
request = {
type: "GET"
} | codefeedback |
Create a MySQL query to select five distinct cities from the given table.
+----+-----------+
| id | city |
+----+-----------+
| 1 | New York |
| 2 | London |
| 3 | Tokyo |
| 4 | Singapore |
| 5 | Sydney |
| 6 | Moscow |
+----+-----------+ | codefeedback |
Generate an algorithm that sorts the elements of an array.
[6, 3, 8, 9, 4] | codefeedback |
Generate a Python script that implements a Linked List data structure. | codefeedback |
Explain how to convert an expression from postfix notation to infix notation | codefeedback |
Write a function in Java that sorts a given array of integers. | codefeedback |
Write a Tensorflow program to perform binary classification on a given dataset. | codefeedback |
Develop a Ruby program to check a given string for palindromes. | codefeedback |
Implement a machine learning model in Python to predict customer churn. | codefeedback |
Calculate the sine of a given angle using JavaScript.
45 | codefeedback |
Implement an algorithm to sort the following array.
[3, 5, 4, 6, 1, 2] | codefeedback |
List two advantages and two disadvantages of using a linked list data structure | codefeedback |
What is the most efficient sorting algorithm for a large data set? | codefeedback |
Write Java code to calculate the sum of first n natural numbers. | codefeedback |
Write code in Java to print all the unique elements in an array. | codefeedback |
Write a short Java program to generate a random value from 1 to 10. | codefeedback |
Create a function that takes a sentence as a string and returns a string containing the sentence in reverse order.
"I am learning to code" | codefeedback |
Create a function to find the standard deviation of a list of numbers
[2,4,4,4,5,5,7,9] | codefeedback |
Write a C++ program to find the kth smallest element in an unsorted array using minimum number of comparisons. | codefeedback |
Write a JavaScript program to classify a given array of strings into two groups- one which contains elements that can be parsed into numbers and one which can't. | codefeedback |
Write an HTML page to display a given data table. | codefeedback |
Implement an algorithm to split a string of numbers (integers or floats) in to two parts with an even sum
inputString: '1,2,3,4,5,6' | codefeedback |
Create a SQL query to calculate the total cost of an order taking into account the quantity and unit cost of each item. | codefeedback |
Build a neural network for binary classification using TensorFlow. | codefeedback |
Use the following function and SQL query and write a JavaScript program to insert data into a given table.
function insertData(arr) {
let sqlQuery = "INSERT INTO <table_name> (NAME,AGE) VALUES ?";
} | codefeedback |
Write a C++ program to calculate the difference between two dates using the following function. | codefeedback |
Write a single-line lambda expression that multiplies any two numbers. | codefeedback |
Generate a list of numbers from 1 to 10 in reverse order. | codefeedback |
Is there an error in the following code?
price = 10
if prive > 10:
print('Price must be 10 or less') | codefeedback |
Write a code to reverse the order of characters in a string.
text = "Hello World" | codefeedback |
Create an object-oriented program in Java to calculate the area of a rectangle. | codefeedback |
Given a sentence as input, check if the sentence is a palindrome
"Madam, I'm Adam" | codefeedback |
How can a user increase performance with SQL queries? | codefeedback |
Create a Java method to print a binary tree in level order. | codefeedback |
Create an array of integers ranging from 0 to 20 and print it. | codefeedback |
How would you implement a Binary Search Tree in Java? | codefeedback |
Write a SQL query to select all the distinct cities in the given dataset. | codefeedback |
Create a boolean function to check whether a given string contains all alphabets
phrase = "The quick brown fox jumps over the lazy dog" | codefeedback |
Write a function to find the n-th Fibonacci number for a given n | codefeedback |
Create a function in C that creates a new string with all the characters in reverse order. | codefeedback |
Generate a pseudocode of a breadth first search algorithm. | codefeedback |
Edit the code below to add an exception handling mechanism in it.
def divide(a, b):
return a/b | codefeedback |
Create a list of the first 10 perfect squares. | codefeedback |
Given an array of integers, write a Java method to find the largest three numbers.
[3, 5, 9, 4, 8, 6, 1] | codefeedback |
Using the given list, calculate the mode and median.
[2, 4, 5, -6, 8, 9, -9, 10, 19] | codefeedback |
Use regular expression to match all valid URLs in a string.
// This is a string containing valid and invalid URLs
let string = 'https://www.example.com/?q=test http://example.org#page http://example.com/# invalid_url' | codefeedback |
Reorder an array of numbers in descending order.
let array = [3, 8, 5, 1, 9] | codefeedback |
Reverse the order of a list without using the built-in reverse function. | codefeedback |
How can we check if a given string is a valid IP address or not? | codefeedback |
How can we sort a given list of integers in ascending order? | codefeedback |
Write a SQL query to list the names of all members who have not yet made a payment this month.
Table: members
Fields: member_id, name, paid_this_month | codefeedback |
Write a function in C# to find the area of a triangle given 3 side lengths. | codefeedback |
Create a data structure in C to store student information, including name, age, statistical data. | codefeedback |
Construct a regex in Java that matches a valid email address. | codefeedback |
Create a function that takes a string and returns the longest set of characters in descending order.
Hello World | codefeedback |
Design an algorithm to find the maximum number from a set of numbers
Set of numbers: [24, 5, 40, 15] | codefeedback |
Generate a list of words that contain the substring "al" using Python. | codefeedback |
Create a function in Swift to split a string by the given delimiter. | codefeedback |
Implement an efficient sorting algorithm in Python. | codefeedback |
Given an array of integers, write a function to determine whether the array is a palindrome.
array = [1,2,3,2,1] | codefeedback |
Convert a natural number to its binary representation.
n = 4 | codefeedback |
Explain the differences between the list, set, and dictionary data structures in Python. | codefeedback |
Using the provided data structure, create a class in Python to represent a car.
car = {
"make": "Honda",
"model": "Civic",
"year": 2011
} | codefeedback |
What is the time complexity of the Bubble Sort algorithm? | codefeedback |
You need to write a program to convert a given number to its binary representation. | codefeedback |
You need to convert any given number to its octal representation. | codefeedback |
Design a regular expression for validating email address. | codefeedback |
Create a program in Assembly that adds two numbers and prints the result. | codefeedback |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.