instruction_seed
stringlengths
0
26.4k
source
stringclasses
4 values
Sort a given matrix such that the elements in each row are in increasing order. [[9, 2, 7], [5, 1, 6], [3, 8, 4]]
codefeedback
Build a neural network with one input layer, two hidden layers and one output layer, using Keras.
codefeedback
Write a regular expression to match numbers that start with 8
codefeedback
Write a function in Java to find the intersection of 2 arrays.
codefeedback
Incorporate the PUT method in the given URL. URL: https://example.com/users
codefeedback
Write a HTML code for creating a dropdown list with 3 list items.
codefeedback
Write a JavaScript snippet to make all the <div> elements in a webpage pink in color.
codefeedback
Describe the difference between static and dynamic programming
codefeedback
Write a SQL query to show all the students from the database 'students' with a first name starting with 'A'.
codefeedback
Format the following JSON string. {"name":"John", "age":30, "city":"New York"}
codefeedback
How do you sort an array of integers in ascending and descending order?
codefeedback
Write a function which checks if a number is a prime number.
codefeedback
Use an SQL query to count the number of different job roles in the employee table.
codefeedback
Write a while loop in Java to print all even numbers between 0 and 20
codefeedback
Develop a regular expression to detect a valid e-mail address
codefeedback
Design a distributed system to store and retrieve large amounts of data.
codefeedback
Design a web application that allows users to enter a text query and get results in an arranged format.
codefeedback
Design a solution for the Towers of Hanoi problem using Java.
codefeedback
Design an algorithm that can be used to identify if a given binary tree is a valid BST.
codefeedback
Generate a program in JavaScript to find the longest common substring of two strings. str1 = "abcd" str2 = "cdefg"
codefeedback
Create a dictionary where the keys are the integers up to 10, and the values are the cubes of those same integers.
codefeedback
Create a function that produces input strings for a calculator.
codefeedback
Write a function that produces an array of Fibonacci numbers with n numbers.
codefeedback
Output all the elements in an array where the last character of the element is 's'. ['apple', 'cat', 'dog', 'elephants']
codefeedback
Create a 16-bit hash for this data. Data: 0x0010
codefeedback
Name the class for this object-oriented design. [Image]
codefeedback
Write Javascript code to create a timeout to set a message after 5 seconds.
codefeedback
Print the longest substring of a string that does not have any repeated characters. string = "abcaabccbad"
codefeedback
Generate a program to delete a node with a given value from the Linked List. linked_list = [10, 5, 3, 4, 6, 5] value = 5
codefeedback
Create an array of strings, such that it contains strings of all possible combinations of n characters from a given string of characters. Given string: "ABC", n = 3
codefeedback
let A be a n x n matrix, write a function to calculate the trace of A A = [[1,2,3],[4,5,6],[7,8,9]]
codefeedback
Construct a class in Python that describes a car
codefeedback
Write a function that takes a string and returns the number of times the string occurs in the given array string = "hello", arr = ["hello", "hi", "hello", "salut"]
codefeedback
Write a function that calculates the average of all the numbers in a given array. arr = [2, 6, 21, 14, 8]
codefeedback
Create a function that prints out an ASCII art of a unicorn.
codefeedback
Write a function that given a positive number, returns the sum of all positive numbers from 1 to the given number. number = 10
codefeedback
What are the different ways to loop through a list in Python?
codefeedback
Define a function to calculate the median of a given array of numbers.
codefeedback
Create a function to calculate the value of "e" to the nth term. term = 5
codefeedback
Create an SQL query to calculate the total sales per month.
codefeedback
What is a Heap in data structure?
codefeedback
Write a C# code to convert a given number to words. 563
codefeedback
Generate 10 random numbers between 5 to 10.
codefeedback
Construct a binary search tree from the given array of integers. [ 10, 5, 15, 1, 8, 12, 2 ]
codefeedback
Create a program to find the most frequently used word in a given text. Text: Machine learning is a subset of artificial intelligence and is a powerful tool in data science.
codefeedback
Construct a regex expression that will check if a email is valid.
codefeedback
Create a SQL query that will calculate the maximum value for a given column. Table T: Columns: [A, B, C] Rows: [1, 2, 3, 4]
codefeedback
Rewrite the given function without using the ternary expression. def func(x): return x if x > 0 else x + 10
codefeedback
Write an HTML code snippet to display a blue heart symbol.
codefeedback
Develop an AI model to classify emails with spam contents.
codefeedback
Develop a natural language processing model to detect sarcasm in text.
codefeedback
Use a switch statement to check if a number is between 1 and 10. 7
codefeedback
Convert this Python statement into a list comprehension. for item1 in list1: for item2 in list2: if item1 == item2: result_list.append(item1)
codefeedback
Write SQL code to remove duplicates from a database table. Table name: Items Columns: ID, Name
codefeedback
Write a Java method which will print the Fibonacci sequence based on a given number.
codefeedback
Modify the program to accept user input of two numbers, and show the result based on the operator provided. def calculate(num1, num2): result = num1 + num2 return result
codefeedback
You are given an array of integers and you need to find three numbers such that the sum of the three numbers is 0. nums = [-40, 40, -20, 60, 10, -80]
codefeedback
Write a regular expression to detect any email address.
codefeedback
Describe a complete algorithm for sorting n integers.
codefeedback
In Python, write a program to remove all duplicates from a given list of integers.
codefeedback
Produce an R command that fits a linear regression model of the following form: y ~ x1 + x2 + x3.
codefeedback
Make a JavaScript fibonacci sequence generator that takes a given number from the user and prints out the first n elements of the fibonacci sequence.
codefeedback
Create a function in JavaScript which prints all prime numbers up to a given number.
codefeedback
What is the principal difference between a linked list and an array?
codefeedback
Write a function to calculate the sum of the elements of an array with float values.
codefeedback
Write a Python program to find the closest number in a given array to a given number. Array: [3, 6, 9, 12, 15], Number: 10
codefeedback
Remove all non-alphabetical characters from the given string. String: "Hello,123_[World!]%$"
codefeedback
Write a method to find the maximum number of elements in an array such that all subarrays add up to a specified number. arr = [1, 2, 3, 4, 5, 6, 7]
codefeedback
Write a function to join a list of strings using a given character.
codefeedback
Find the smallest positive number that is not present in a given list. my_list = [1, 3, 6, 9, 11]
codefeedback
Print a random permutation of an array of integers. [1,2,3,4,5]
codefeedback
Write a function to convert an anagram of a string to a dictionary word = "geeksforgeeks"
codefeedback
Implement a neural network for regression
codefeedback
Implement Naive Bayes for classification.
codefeedback
Write code in Java to calculate the minimum number of coins needed to make change for a given amount. Coin denominations: [1, 5, 10, 25] Amount: 27
codefeedback
Construct a regular expression that extracts substrings that match the pattern "AAA_BBB_CCC".
codefeedback
Write a function to delete a node from the given linked list. Linked list: 10 --> 20 --> 30 Node to delete: 10
codefeedback
How can you use the modulo operator to print even numbers in a loop?
codefeedback
Given an input string and a pattern, find the first index of the pattern in the string. string: “The quick brown fox jumps over the lazy dog” pattern: “dog”
codefeedback
Decompose a given number into its prime factors. 25
codefeedback
Design an algorithm to compute the number of trailing zeroes in a factorial number.
codefeedback
Generate a sequence of prime numbers between a given range using the Sieve of Eratosthenes algorithm.
codefeedback
How many lines would the following algorithm require? # Find all the prime numbers between two given numbers # Input: two numbers, n1 and n2 # Output: list of prime numbers between n1 and n2
codefeedback
Write a search engine using an index in JavaScript.
codefeedback
Construct a regex to match any 5-digit US zip code.
codefeedback
Given an array of integers, write a program to find the longest consecutive sequence. [1, 9, 3, 10, 4, 20, 2]
codefeedback
Write a SQL query to find customers who have purchased the most items in the last month.
codefeedback
Create a class in Java to store student grades with functions for adding and calculating average grades.
codefeedback
Convert the given HTML code into its equivalent JSON structure. <div> <h2>Hello World!</h2> <p>My name is John.</p> </div>
codefeedback
Find all character positions in the given string String: abracadabra
codefeedback
Write a SQL query to find the employee names who are working in the company since Jan 2019.
codefeedback
Create an algorithm that will return all numbers in the given array that are greater than 10. [5, 8, 10, 12, 15, 17, 20]
codefeedback
Design an algorithm that can efficiently search for an element in a given sorted array
codefeedback
Write a TensorFlow program for a linear regression model.
codefeedback
Create a HTML page that shows a profile page for a user.
codefeedback
Explain B-Tree data structure.
codefeedback
Describe the Divide-and-Conquer algorithm.
codefeedback
Edit the following code to make the function return the value of n mod m. int modulo(int n, int m) { return n / m; }
codefeedback
Generate a random sequence of letters containing 5 characters without repeating a character.
codefeedback
Write a query in MySQL to delete all rows with a given ID.
codefeedback