Questions tagged [search]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
33 views

pset3: linear search (strange behaviour)

My code is going through check50 okay, but when I try to check it manually it doesn't seem to be able to find the needle in the haystack. I can't figure out why that is happening that's why I'm hoping ...
0
votes
1answer
28 views

Error with fifteen?

I am taking the Harvard ap cs5o class, and I just started the pset3's fifteen. I followed the directions to get the skeleton code from here: Problem scope After reading and following along I tried ...
0
votes
2answers
104 views

Help finding segmentation fault

In my code, I get a segmentation fault some, but not all of the times that I run it. Sometimes, it sorts the code and finds the needle, sometimes it doesn't sort correctly and ends with a segmentation ...
0
votes
1answer
48 views

Check 50 for find

I have gotten most of my code to work for the search and sort, but I still have a few issues. One is i my for loop, I have it set to less than 100, though I need to make it less than log n, but I ...
0
votes
2answers
54 views

binary search pset 3 pointer to integer error

I am trying my hands on binary search. I get those pointer to integer errors :( Can sonmeone more experience give me a hand ? bool search(int value, int values[], int n) { int first=0; int last=n-1; ...
0
votes
1answer
46 views

Find Search Help (improved)

For pset3's findsearch, i saved the this code #include "helpers.h" bool search(int value, int values[], int n) { // removed implementation due to academic honesty rules } in helpers.c and ...
0
votes
0answers
13 views

How do I start project0 search?

Yes, I know that it shows the code to get it started but I personally do not know how to start it. Yes, I was told to start it on Scratch but other than playing with a sprite, I do not know where to ...
0
votes
0answers
35 views

TicTacToe task: PyGame display not rendering

For some reason, the PyGame TicTacToe display is not showing. It just hangs at this: This is the runner.py: import pygame import sys import time import tictactoe as ttt pygame.init() size = width, ...
0
votes
1answer
524 views

CS50 Problem Set 3 Helpers.c PROBLEMS

I have been trying to solve Pset3 search and sort - looked at all possible online forums but I cannot solve it. Please help. Where am I going wrong? Is my binary search OK? What about my bubble sort? ...
0
votes
1answer
295 views

pset8 - search function in application.py

My search function returns the correct results when I am using for example q=Cambri but when I try to search using for instance q=021 nothing is returned. In my database I have set postal_code field ...
0
votes
1answer
245 views

Search function do not work if several words entered

Both mine and stuff solutions do not work for examples like (where there is two of more words from different db fields): https://ide50-username.cs50.io/search?q=New+Haven,+Connecticut // http://pset8....
0
votes
1answer
75 views

pset3 find, failing half the checks!

so currently doing pset3 & i think my sort function is all good (i've printf'd each value & it's all in the right order), but when trying to implement binary search it's failing half the tests ...
0
votes
1answer
732 views

Binary search question

I'm currently struggling with the binary search in pset 3 and I think I already found out how to implement it. I just really can't understand why, after return res;, the program does not leave the ...
0
votes
1answer
81 views

Guys,my code runs perfectly right with check 50 for binary search but doesn't show right output for ./generate 1000 50 | ./find 127.Please help

bool search(int value, int values[], int n) { int middle=(int)((n-1)/2); if(n<0) { return false; } else if(values[middle]==value) { return true; } else if(...
0
votes
1answer
129 views

Staff's solution of search doesn't pass required tests. Mine does, but works much slower

As per specifications we are given links to test return of JSON data for our search requests. But staff's solution doesn't pass them. Check, only first one returns something. http://pset8.cs50.net/...
0
votes
0answers
86 views

pokedex android search error

the code right and I re-write it more than one time and compiler without error but didn't make search public class PokedexAdapter extends RecyclerView.Adapter<PokedexAdapter.PokedexViewHolder> ...
0
votes
1answer
161 views

Search function - Pset8 - Mashup

I found the search query a little bit complicated, in the sense it can be difficult to adjust it to the user's input. For example, how do I permit the user to enter the parameters in different order ...
0
votes
1answer
806 views

linear search compilation error

I've updated search function in helpers.c with code below. I had to remove reference to helpers.h since that was causing even more errors. #include <cs50.h> // #include "helpers.h" bool search ...
0
votes
1answer
94 views

Struggling with logic on cs50 AI search

I completed CS50 intro to computer science a while back and I am starting the AI course now. I watched the lecture, and I understood how the logic worked for the maze and such, but I'm struggling on ...
0
votes
2answers
76 views

PSET3 Binary search not yielding results

I can't seem to figure this out. here's my code bool Binarysearch(int key, int array[], int n){ int end = n-1; int start = 0; while(start<=end){ int midpoint = (((end+start)/2)); if (...
0
votes
0answers
11 views

Why do the deepcopies in my minimax implementation (project 0b) look like they're getting altered?

The minimax function has a max function and a min function. The recursion takes place between them, where the max function calls the min function and the min, calls the max. While exploring a node, ...
0
votes
1answer
28 views

PSet3 helpers.c fails one of the checks

I'm working on the PSet3 Find problem. Here's my code for the sort and search functions: bool search(int value, int values[], int n) { if (value < 0) return false; else { ...
0
votes
1answer
291 views

pset8 2018 mashup search

I have changed nothing in the pset8 distribution code and only implemented search function and formatted configure in script.js, but no suggestion shows up from the search box 'q'. This worked ...
0
votes
1answer
220 views

intersection of a list of arrays, python

I have two arrays that have dictionaries within them (these dictionaries objects in both arrays contain identical keys): a = [{1:"a", 2:"b"},{1:"c", 2:"d"}] b = [{1:"e", 2:"f"},{1:"c", 2:"d"}] I ...
0
votes
1answer
66 views

Specify Multiple Search Conditions for SQL

this is a question about search() in pset8 Mashup. How does one select rows given multiple characteristics(for example in pseudo code, SELECT * THAT CONTAIN KEYWORDS "New Haven" AND "Connecticut" AND ...
2
votes
1answer
365 views

2017 pset8 mashup: Slow search - how to improve search performance?

I have successfully implemented search in application.py. Though ss I was testing through the app, I noticed that every search was really slow. It's turns out that every search request was from 63KB ...
0
votes
1answer
514 views

CS50 Helpers.C Find Less, No Idea What's Going On

Final Code: /** * helpers.c * * Helper functions for Problem Set 3. */ #include <cs50.h> #include "helpers.h" /** * Returns true if value is in array of n values, else false. */ bool ...
0
votes
2answers
42 views

PSET 3, there is nothing happening

My code is not working at all and I am not able to find a proper solution. UPDATE: So I just now came to know that I am not able to use ^d if needle is not found otherwise it is working. /** * ...
0
votes
1answer
345 views

pset8 search function not working like supposed to

I'm trying to implement search in pset8 so that it can narrow down searches based on whether a comma followed by a state name or symbol is included. For example, the standard search would output many ...
0
votes
1answer
45 views

cs50 pset3 binary search

im not sure if my binary search code is correct, when I try to compile it I get the following message: /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has ...
1
vote
0answers
103 views

Why my code is always returning an empty array

Here is my code for application.py pset8 search route which always returns 0 or empty array, I can't figure out why, Kindly help @app.route("/search", methods=["GET", "POST"]) def search(): """Search ...
0
votes
1answer
94 views

pset8-Search error,doesn't work when a place is a parameter

Given below is the code for search , it works fine and outputs correct json object when a postal code is then parameter but fails for places if not request.args.get("q"): raise ...
0
votes
2answers
110 views

Binary Search for helpers.c

so as the title suggests I am having some trouble with my implementation of binary search. So based on the logic shown in the lecture, I think my implementation is fine, indeed it works for the cases ...
0
votes
1answer
511 views

Pset 8 search and configure functions

templates: { suggestion: Handlebars.compile( "<div>" + "{{place_name}}, {{admin_name1}}, {{postal_code}}" + "</div>" ) } In my ...
0
votes
1answer
126 views

pset3 helpers.c (help)

:( finds 42 in {39,40,41,42} \ expected an exit code of 0, not 1 ( it meaning I missing or have a return error??? ) bool search(int value, int values[], int n) {// ...
0
votes
1answer
286 views

PSET8 search empty JSON

I wrote a few lines of code just to detect any problems and I unfortunately did. The following code returns an empty JSON array, only two square brackets with no content between them. I tried using ...
0
votes
1answer
73 views

pset3: search (am I in the right track??)

bool search(int value, int values[], int n) //search for middle lists if (value == values [n / 2]) { return 1; } //number greater search left else if ( value > values[n / 2 ]) { search(int ...
0
votes
1answer
98 views

Pset 3 Recursive Binary Search problems - Always returns true

I have tried almost everything and edited my code a hundred times in search of an answer. It seems that whenever I run the program (find.c) the result always resolves to true. Not sure where the ...
0
votes
1answer
206 views

Query for postal code as well as place and admin name in Search route in application.py mashup

I'm almost done with pset8. Just cant find any documentation that would help me in implementing postal code search in addition to place and admin_name1 search. db.execute returns a string and so ...
1
vote
2answers
135 views

I'm on pset8 testing search.php but this is the result to every url [duplicate]

I'm on pset8. I finished implementing search.php and was now testing it with the urls given but this is the result to every url
0
votes
1answer
6k views

What does “error in backend: IO failure on output stream” signify?

I altered the code in helpers.c in such a way that when the difference between the find value and the "haystack" value equals zero the program returns true. However find will no longer compile and ...
0
votes
1answer
20 views

pset3 Search - 2 equal ints not triggering if

I'm perplexed by an issue I'm having. i've got printfs in here as I was having an argument with gdb earlier on with it not stopping at breakpoints. bool search(int value, int values[], int n) { ...
0
votes
2answers
256 views

Pset3 - Code sorts, but does not find the needle using generate

I have the following code for helpers.c. When I run find, if I input numbers by hand, it sorts them and finds/doesn't find the n correctly. However, when I use generate to input the numbers, I can see ...
0
votes
1answer
22 views

working with pset3

why isnt the compiler returning the false if the needle is not in the haystack.This is my modified code with the SESE method. /** * helpers.c * * Computer Science 50 * Problem Set 3 * * Helper ...
0
votes
1answer
366 views

Cannot find the needle 127 in the haystack of 1000 random numbers using linear search . Any ideas on what I may have done wrong?

I'm having a bit of difficulty in compiling the helpers.c program. Specifically when I try to check the correctness of the program, it seems it cannot find the needle 127 in the haystack of 1000 ...
0
votes
2answers
659 views

Recursive binary function returns error: control reaches end of non-void function

Working on pset3 and tried to write a separate binary search function in helpers.c so I can just call it later in the main search function. Here's my code for the binary search: bool binarysearch(int ...
0
votes
1answer
120 views

Pset8 search add fulltext error

I am trying to add latitude and longitude to my search function. However, when I try to add fulltext in phpmyadmin, I receive the following error: #1283 - Column 'latitude' cannot be part of FULLTEXT ...
0
votes
1answer
361 views

pset3 binary search won't find values when at end of array

As the title says, the program doesn't pass the check when 42 is the last element of the array. I've seen a related post about this issue but it did not give me enough to fix the problem. The code is ...
0
votes
1answer
222 views

pset8 search: FULLTEXT error on including longitude and latitude

If I search for 02138 in the search box of my mashup I do get a match but when I click on that match the map just go blank. Can anyone please tell me why I ma having this problem? EDIT ok have ...
1
vote
1answer
70 views

pset8 search: Which column represents State?

as per specification of pset8's search value of geo, passed into search.php as a GET parameter, meanwhile, might be a city, state, and/or postal code I am not from US so Dont know how the names of ...