Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
43 views

I was trying out this problem link. So we have a list of (key,timestamp,value), where a single key can have multiple (timestamp,value) pairs , and we have to find the greatest timestamp <= a given ...
Denn's user avatar
  • 11
0 votes
1 answer
122 views

I am solving GeeksforGeeks problem The Painter's Partition Problem-II : Dilpreet wants to paint his dog's home that has n boards with different lengths. The length of ith board is given by arr[i] ...
Astha Negi's user avatar
0 votes
1 answer
82 views

Is there anyone give me any hint or guide me what algorithm should i use for search query function in large database (music or songs almost 1000x10) what i have tried so far is Linear search(time O(n) ...
ronark's user avatar
  • 1
0 votes
3 answers
233 views

I am searching in a few arrays of struct stored in program memory with lengths of about 30-200 with a linear search like this: Glyph getGlyph(Font font, uint16_t code) { for (size_t i = 0; i < ...
Torsten Römer's user avatar
1 vote
1 answer
43 views

def linsearch(list, target): for i in range(0, len(list)): if (list[i] == target): return (i) else: return ("not in list") list1 =...
Mayank Singh's user avatar
0 votes
1 answer
113 views

I asked chatgpt to give me some multiple choice questions on linear search algorithms and one of the questions asked was: What is the worst-case scenario for a linear search algorithm? a) The target ...
celestemelissa's user avatar
0 votes
1 answer
49 views

When I used this function, it return -1 even if element of array was there. int linear_search(int arr[], int length, int target) { for (int i=0; i < n; i++) { if (arr[i] == target){ ...
Sayidbek Bahromov's user avatar
1 vote
0 answers
2k views

I have the following python program for Linear Search algorithm: import numpy as np a, item = [2.6778716682529704, 8.224004328108661, 8.819020166860604, 25.04500044837642, 114.6788167136755, 147....
Andy s's user avatar
  • 11
0 votes
1 answer
51 views

I was going through an algorithm course and it demonstrates a basic linear search algorithm and it uses a verify function to verify if the index is right or wrong but I don't understand how the verify ...
Stergios Katseas's user avatar
-1 votes
3 answers
404 views

Which algorithm is better in terms of time complexity and space complexity ? temp_list = [2,4,1,3,7,1,4,2,9,5,6,8] def get_item_from_list1(collection, target): collection_length: int = len(...
SYED FAISAL's user avatar
1 vote
1 answer
450 views

I'm new to programmning and I'm taking a course to learn the basics in c#. Right now I'm doing a console application that are supposed to work as a blog. In the application the user should be able to ...
sam_the_man's user avatar
0 votes
0 answers
33 views

I am trying to use a linear/sequential search through a list which contains data about users. I need to search for the users by first and last name and then retrieve the remaining list data to be ...
Ethan Cunningham's user avatar
0 votes
1 answer
264 views

The goal of this project is to create a class search. I will need methods of binary search and linear search. For each method you are going to ask the user for a key, then search for this key in an ...
killered1's user avatar
1 vote
1 answer
148 views

public static int[] linearSearch(int arr[], int x) { for (int i=0; i<arr.length; i++) { if (arr[i]==x) { return arr; } } } ...
Utsav's user avatar
  • 13
1 vote
1 answer
63 views

You are given three integers A, B, and C. You are allowed to perform the following operation any number of times (possibly zero). • Choose any integer X such that X ≤ max (A,B, C), and replace A with ...
Rutwik Patil's user avatar

15 30 50 per page
1
2 3 4 5
19