instruction_seed
stringlengths
0
26.4k
source
stringclasses
4 values
Create a recursive Python function to generate the Fibonacci series up to n-th terms.
codefeedback
Create a function to input a number and prints out its prime factorization 24
codefeedback
Create a program to convert a binary number to its decimal equivalent.
codefeedback
Generate a valid Java code for a for loop to count from 5 to 10.
codefeedback
Sort a given list of numbers from smallest to largest with Python. [12,3,7,9,1]
codefeedback
Create a K Nearest Neighbor (KNN) classifier in R.
codefeedback
Generate 10 random strings of 5 characters in length with JavaScript.
codefeedback
Implement a Search algorithm in Python with a space complexity of O(n).
codefeedback
Write a C++ program to create a binary search tree.
codefeedback
Group the list into a Dictionary Key/Value pair, where the key is the name and the value is number of pet animals owned. pets = ["Henry 12 dogs", "Eric 2 cats", "David 7 birds"]
codefeedback
Create a new string that contains all uppercase letters from the original string. my_string = "Hello World!"
codefeedback
Construct a SQL query to retrieve the records from a table that satisfy a certain condition.
codefeedback
Create a function 'convertStringToInt' that takes a string and converts it into an integer.
codefeedback
Create a program that reads 6 numbers from the user and outputs whether they form an increasing subsequence of length 3 or not.
codefeedback
You are given an array of integers and the task is to create a function that returns the maximum pairwise product of those numbers.
codefeedback
Create a program that reads a list of integers and returns the highest prime number in the list.
codefeedback
Create a program that reads an integer N and calculates the sum of the series 1/1 + 1/2 + 1/3 + . . . . . + 1/N.
codefeedback
How would you convert a number from decimal to binary using bitwise operators?
codefeedback
Create a program to calculate the Fibonacci sequence up to the nth element.
codefeedback
Determine the two largest numbers in a given list. lst = [11, 5, 3, 21, 19, 17]
codefeedback
Given an integer n, write a Python program to print a pattern. n = 5
codefeedback
Edit the function so that an element can be deleted from the list. def delete_element(list, element): # TODO
codefeedback
Write a code to find the factorial of a given number using a recursive function.
codefeedback
Compute the minimum string edit distance between two strings of same length. str1 = "kitten" str2 = "sitting"
codefeedback
Construct a SQL query that gets the average salary of all employees who work in Department A
codefeedback
Build a machine learning model to classify the type of iris flower.
codefeedback
Create a function which takes a set of numbers as argument and returns a dictionary containing the frequency of each number. my_set = {1, 2, 2, 3, 4, 5, 6}
codefeedback
Explain what an abstract data type is and provide an example in C++.
codefeedback
Write an algorithm in MIPS assembly language to determine if a given character is an uppercase letter or not. Character: ‘A’
codefeedback
What is the Big O time complexity of selection sort?
codefeedback
Write a regex pattern for identifying a valid email address.
codefeedback
Write an MySQL query to create a view displaying the average monthly income per worker Table contains workerid, month, income columns
codefeedback
Write an algorithm to solve the Stock Span problem. [100, 80, 60, 70, 60, 75, 85]
codefeedback
Generate a valid Python expression that multiplies the given numbers. 3 and 4
codefeedback
Write a pseudocode for the Depth-First Search algorithm
codefeedback
Design a JavaScript function that can convert any string into a camel case version.
codefeedback
Write a HTML structure with a form that includes ``name`` and ``email`` fields.
codefeedback
Write a function to detect the smallest window in a string containing all characters of another string. string1 = "abcde", string2 = "ade"
codefeedback
Given a matrix, write a program to traverse it spirally. matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
codefeedback
Implement a heuristic algorithm in Python to find an approximate solution to the traveling salesman problem.
codefeedback
Generate a random 10 character alphanumeric string in Python.
codefeedback
Develop a machine learning system to detect fraud.
codefeedback
Develop an algorithm to implement a tree traversal.
codefeedback
Implement a basic calculator in Java.
codefeedback
Create a Python class for a thread-safe queue.
codefeedback
Given a 2D array, print out all the elements in a spiral order. [ [1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13, 14, 15], [16, 17, 18, 19, 20], ]
codefeedback
Create a dictionary with key as the string and values as the number of occurrences of the respective character in a given string. mystring
codefeedback
Generate a random string of 10 characters with two vowels, three consonants and five digits.
codefeedback
Given a list of integers, write a program to check if there exist any pairs of numbers that sum to a given number. v = [2, 3, 4, 9], sum = 8
codefeedback
Find the maximum of three integers without using any comparison operator.
codefeedback
Output a valid C++ code to implement a Binary Tree.
codefeedback
Write a C++ program to print the numbers from 0 to n (in ascending order). n=20
codefeedback
Define a function in Python that takes an integer and returns "positive" if it is positive, "zero" if the integer is 0, and "negative" if the integer is negative.
codefeedback
Describe the algorithm and time complexity of selection sort.
codefeedback
Implement a SQL query to select all distinct entries from a table.
codefeedback
Write an SQL query to retrieve all the columns and the total count of each column record from a table.
codefeedback
Convert the following sentence into a valid regular expression. The text must contain the words “start”, “end”, and “here”.
codefeedback
Calculate the sum of the following 2-dimensional array in Python. arr = [[1, 2], [3, 4], [5, 6]]
codefeedback
Analyze the computational complexity of the following piece of code. int fun(int n){ if(n < 2){ return n; } return fun(n-1) + fun(n-2); }
codefeedback
Compile this piece of C code to an executable program #include <stdio.h> int main() { int a = 5; int b = 10; int c = a + b; printf("%d",c); return 0; }
codefeedback
Explain how you would use machine learning to predict the price of a certain type of car.
codefeedback
Create a web scraper that extracts data from a given URL. URL: https://www.reuters.com/article/us-oil-production/u-s-oil-production-touches-a-record-high-idUSKCN1VA19P
codefeedback
Make a deep copy of an object using JSON.
codefeedback
Write a code that adds two integers without using any arithmetic operators.
codefeedback
Create a list comprehension to generate a new list of composed strings. names = ["John", "Steve", "Bob"] blanks = ["__'s cat", "__'s dog", "__'s parrot"]
codefeedback
How to write an HTML page that displays the number from 1 to 10?
codefeedback
How to create a GraphQL query to fetch the name and age of all users from the table 'users'?
codefeedback
Construct a query in SQL to get the names of all customers who have purchased a product with price greater than $50.
codefeedback
Sort the following array of strings alphabetically in C++. string array[] = {"sun", "mon", "tues", "wednes", "thurs"};
codefeedback
Develop an algorithm in Python to reverse a given string. string = "Hello"
codefeedback
Implement the bubble sort algorithm in JavaScript.
codefeedback
Write a jQuery code snippet to change the text color of all p tags to red.
codefeedback
Generate a random hexadecimal string with a length of 8 characters.
codefeedback
Write a code to implement Multiple Linear Regression for a dataset.
codefeedback
Describe an efficient way to find the minimum value in an unsorted array.
codefeedback
How can you convert a binary search tree into an array?
codefeedback
Construct a Linked List class.
codefeedback
Construct a Fibonacci Heap class.
codefeedback
Generate a class in Java that validates if a given number is a prime or not. Number: 13
codefeedback
Build a machine learning model to predict the outcome. Input dataset of 200 records with 10 features
codefeedback
Identify the parts of speech of the words in the sentence. The cat ran quickly across the street.
codefeedback
Write a function to replace all whitespaces with the character '*'. my_string = "This is a string with whitespaces"
codefeedback
Construct a CFG to describe the given language. The language {anbmcn | n, m ≥ 0}
codefeedback
What is the mathematical expression for calculating next fibonacci number from any number?
codefeedback
Write a regular expression to match the phone numbers which start with 6 and have 11 digits.
codefeedback
Write a function to sort a list of integers in non-increasing order [9, 6, 7, 4, 3, 5]
codefeedback
Create an object-oriented Python program to simulate a simple calculator with a add, subtract and \multiply" function
codefeedback
Write a code to reverse a sentence word by word. This is a sentence
codefeedback
Create a generator which generates the first ten square numbers.
codefeedback
Transform the following regular expression so that it matches any string that doesn't contain "cat". let regex = /cat/
codefeedback
Compute the overall rating for each product as the weighted sum of ratings given for each feature. product_id | feature_id | rating 1 | 1 | 5 1 | 2 | 4 1 | 3 | 2
codefeedback
Write a Python program to find all pairs of numbers in the given list whose sum is equal to the given number. nums = [1, 2, 3, 4, 5], sum = 8
codefeedback
Write a regular expression to validate a string which contains the characters "a", "b", "c".
codefeedback
Write a JS code to detect peaks for an array of numbers. [4, 2, 3, 6, 10, 1, 12, 5]
codefeedback
Write a recursive function in JS to traverse a multi-dimensional array. let arr = [ [1, 2], [3, 4], [5, 6] ];
codefeedback
Write a Python script to find all the numbers which are divisible by 7, but are not multiples of 5; between 2000 and 3200 (both included).
codefeedback
Construct a regex pattern to validate an email address.
codefeedback
Implement a breadth-first search algorithm to find the shortest path between two nodes.
codefeedback
Write a regular expression to match a positive or negative floating-point number.
codefeedback
Identify the bug in the following code and provide a solution. def calculate_average(numbers): sum = 0 for number in numbers: sum += numbers return sum/len(numbers)
codefeedback