instruction_seed
stringlengths
0
26.4k
source
stringclasses
4 values
Develop a program that takes a number and prints "true" if it is a prime number, and "false" otherwise.
codefeedback
Implement a recursive binary search on a given sorted list. [-4, -2, 0, 6, 7, 8]
codefeedback
Clean up the following json data so that all the fields are consistent with the same data type. { "person": { "fullname": { "firstname": "John", "lastname": "Smith" }, "age": 45, "hobbies": ["sample hobbby 1", "sample hobby2", 3] } }
codefeedback
Create a program in C to find the difference between the smallest and the largest number in a given array. array = { 100, 2, 11, 1, 5, 34, 45 }
codefeedback
Describe how a bubble sort algorithm works.
codefeedback
Generate code to parse the following HTML. <div> <h1>Heading</h1> <p>Content 1 </p> <ul> <li>Item 1</li> <li>Item 2</li> </ul> </div>
codefeedback
Construct a REST API to get the list of current events from a Web Calendar application.
codefeedback
Create a customer management system using Python and the Django web framework.
codefeedback
Construct a GraphQL query for retrieving posts for the selected user.
codefeedback
Implement an Insertion Sort algorithm in Java.
codefeedback
Create an Express application for a web store with endpoints for adding products, deleting products and viewing products.
codefeedback
Provide an example of a recursive Python function to calculate the factorial of a number.
codefeedback
In a Java program, write a method to find the longest common subsequence of two strings.
codefeedback
Suggest a way to sort a given array using insertion sort algorithm. int arr[] = {82, 2, 25, 14, 5, 9}
codefeedback
Write a function to compute a hash code for a string.
codefeedback
Build a program in C++ which finds the largest element in an array. int arr[] = {2, 3, 5, 8, 9}
codefeedback
Generate a code in C to check if a sentence is a palindrome. char str[] = "amanama"
codefeedback
Construct a MySQL query to find the 3 employees with the highest salaries.
codefeedback
Write pseudocode to sort a given list of integers using bubble sort.
codefeedback
Create a Perl regular expression to verify if a given string is a valid email address.
codefeedback
How would you check if a string contains only digits in C++?
codefeedback
Compress a string using Huffman coding in Python. String: "aaabbcc"
codefeedback
Find the longest common subsequence for two strings in C++. String 1: "abcdef" String 2: "abdee"
codefeedback
Write a C# method to check if a string contains a specific substring.
codefeedback
Suggest an algorithm to calculate the multiplication of two integers without using the operator '*'.
codefeedback
Write a SQL query to select the first name and last name of all employees whose salary is greater than $50,000.
codefeedback
Write an algorithm that takes in an array and determines if it is a valid BST. [9, 7, 3, 15, 20]
codefeedback
Write a code to generate a list of all possible permutations of a given string. "ABC"
codefeedback
Code an algorithm to reverse an array of integers. [1, 3, 4, 6, 8]
codefeedback
Write a function that takes as input a string and returns a new string with all the vowels removed.
codefeedback
Write a pseudo-code to implement a simple sorting algorithm.
codefeedback
Classify this text as either positive or negative I'm not sure if I'll ever be able to turn this situation around.
codefeedback
Can you write a code to delete all the items whose key starts with "item"? { "item1": "apple", "item2": "banana", "item3": "cherry", "item4": "durian", "food1": "bacon" }
codefeedback
Write a method that takes 2 strings and determines if the first string contains the second string as a substring. String 1: bus ride String 2: ride
codefeedback
Given a number N, write a function to check if N is prime. Number: 11
codefeedback
Write a code snippet to select all HTML elements with the class name "button" from an HTML document.
codefeedback
How would you check if two strings are anagrams in JavaScript?
codefeedback
Resolve the given linked list into a cycle using the Floyd's Cycle algorithm.
codefeedback
What is the highest peak in the world?
codefeedback
Write a SQL query to find all the customers who are over 50 years of age.
codefeedback
Generate a valid HTML form for a login page. Username: Password:
codefeedback
Create a regular expression to validate an e-mail address.
codefeedback
Create a program in Ruby that encrypts the given data using AES-256 encryption algorithm. "Hello, I'm a secret message to be encrypted!"
codefeedback
Design a database schema for storing user information such as their email, name and avatar.
codefeedback
Describe in Python a custom exception for handling database connection errors.
codefeedback
Sort a list of integers in ascending order using selection sort. [ 9, 5, 2, 0, 7, 4, 1, 8, 6, 3]
codefeedback
Implement a function in JavaScript that flips a given binary tree.
codefeedback
Print the decimal equivalent of a given binary number. 11100011
codefeedback
Classify the given sentence according to the Syntactic parse tree and label each part of the sentence. I bought a car yesterday.
codefeedback
Using an OOP approach, create an Animal class with properties of name and a virtual property age that gets calculated based on the creation date.
codefeedback
Implement a sorting algorithm for a given array in Python. [3, 2, 1, 4]
codefeedback
What is the complexity of the algorithm to reverse a given string?
codefeedback
Name the main features of a class-based programming language.
codefeedback
Implement a thread pool in Java.
codefeedback
Establish a connection between the web and database server.
codefeedback
Create a regular expression for matching email addresses.
codefeedback
Write a function that takes three parameters; a list of strings, an index of integers, and an alphabet string. The function should return only the items from the list at the specified indexes using letters from the alphabet as keys. list_of_strings = ["Foo", "Bar", "Baz"] indexes = [0,2] alphabet_string = "abc123"
codefeedback
Create a program that reads a string input and replaces all instances of a word with a given replacement Original string = "Merry Christmas everyone, what a lovely day!" Replacement word = "Happy"
codefeedback
Create a PHP function that finds the maximum of three numbers.
codefeedback
Suggest a way to finish the following instruction. Create a Java program to
codefeedback
Write a function to find the length of the longest word in a sentence. sentence = "Today is a beautiful day"
codefeedback
Sort a given list in increasing order. my_list = [3, 4, 2, 6]
codefeedback
Sum up the digits in the given integer. 12345
codefeedback
Describe what a quicksort algorithm does?
codefeedback
What is the time complexity of a binary search tree?
codefeedback
Write a code to convert a string to a list of characters.
codefeedback
Format the following HTML code into a valid HTML document. <title>My Website!</title><h1>Welcome</h1>
codefeedback
Write a Node.js program to find the sum of first n natural numbers.
codefeedback
Given a string, edit it so that every first letter of each word is capitalized. string = "this is a test string"
codefeedback
Rearrange the given string in alphabetical order. string = 'zxcvbnmlkjhgfdsaqwertyuiop'
codefeedback
Print the third item of the list. my_list = ["apple","banana","cherry"]
codefeedback
Outpus true if the given number is a power of two, False otherwise. n = 16
codefeedback
Using Python, write a function to multiply two matrices.
codefeedback
Change the following loop so that it prints out the numbers from 10 to 1 in descending order. for i in range(1, 11): print(i)
codefeedback
Write a function to parse a string of HTML and replace all occurrences of <b> with <strong>. html_string = "<h1> This is a heading </h1> <b> This is a bold text </b>"
codefeedback
For the following JSON object, write a function to get the average of all prices. data = [ { "name": "apple", "price": 2}, { "name": "banana", "price": 4}, { "name": "cucumber", "price": 6}, ]
codefeedback
Given a string, rearrange the characters in the string such that no two consecutive characters are the same. my_str = "ababab"
codefeedback
Output a string that is the reversed version of a given sentence. Reverse “Where the wild things are”
codefeedback
Create a program that can output the permutation of a given string. Find the permutation of “ABC”
codefeedback
Write a machine learning model to classify whether a given email is spam or not using logistic regression.
codefeedback
Build a decision tree model using Scikit-Learn to predict the type of iris plant based on petal length, petal width, sepal length and sepal width.
codefeedback
Write a CSS code snippet to add a shadow effect to all buttons on the page.
codefeedback
How can you convert a given object to a JSON string in JavaScript?
codefeedback
Explain the concept of parameter estimation in machine learning.
codefeedback
Design a function to convert a ternary tree to a doubly linked list.
codefeedback
Write a MySQL query to find the title of the books with the least number of pages.
codefeedback
Implement a function to traverse a binary tree in pre-order.
codefeedback
Describe how reinforcement learning works.
codefeedback
Explain the concept of transfer learning.
codefeedback
Explain recursion in programming.
codefeedback
Generate a program to get the min and max values from a list in one line.
codefeedback
Explain polymorphism in Python.
codefeedback
Construct a Tensorflow model to classify the following inputs. Images with labels “cat” and “dog”.
codefeedback
Write a C++ function that takes an array of strings and prints them out in reverse order. myArray = ["cat","apple","dog"]
codefeedback
Write a code snippet to implement a binary search algorithm.
codefeedback
Translate the following polar equation into a Cartesian equation. r = 2 sin(θ)
codefeedback
Write a SQL query to display the name and country of the customers who have purchased products in the last 24 hours.
codefeedback
Write an SQL query that finds the most popular product sold today (in terms of quantity), along with the quantity sold.
codefeedback
Write a script that prints out the first 100 prime numbers.
codefeedback
Using the array, sort it using insertion sort. arr = [4, 2, 6, 7, 1]
codefeedback