Questions tagged [algorithm]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

Converting to Algorithm(Flowchart)

First time I am learning algorithm and coding and could u convert this Stratch code to simple algorithm diagrams(flowchart)? Thank you. Picture:
user avatar
0 votes
1 answer
65 views

Can you help me to understand why does the output of time function vary every time while applying it on same file with same sort type?

When I run for example (time ./sort1 random5000.txt) it gives me real, syst, and user time. But if I run the same command again it will gives me different time results! I can't understand why this ...
user avatar
0 votes
1 answer
104 views

PS2 Caesar Algorithm

#include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <stdlib.h> int main (int argc, string argv[]) { //Terminates if Command-line ...
user avatar
0 votes
3 answers
39 views

Why are algorithms mentioned in week 2

In week 2 David mentions Algorithms e.g. Bubble sort, Binary search etc... But why are they important? and where do they fit into the bigger picture? I only did the Caesar cypher and Vigenere cypher ...
user avatar
0 votes
1 answer
50 views

Iterative vs Recursive

I have searched in many resources on web and most of them claim, that iterative way of problem solving is faster. Plus, as I understood, recursive should require more memory during processing. My ...
user avatar
  • 5
0 votes
0 answers
141 views

FATAL: varcache miss for varobj var50.0 while using debug50

I am trying to debug a code but whenever I try to run gdb I'm getting FATAL: varcache miss for varobj var50.0 #import <stdio.h> int main(){ int n; scanf("%d",&n); int arr[1000]...
user avatar
0 votes
1 answer
23 views

Can anyone explain that attendence algoritm of week 0 lecture?

The week 0 lecture of CS50 edx. I was not able to understand how did we come to 546 student.
user avatar
0 votes
3 answers
897 views

pset 1 credit.c invalid cards are valid by cs50

It was said that you can verify if the credit card number is valid by using Luhn’s algorithm. If you done mathematical operations right, after them, you know if the card is valid if the last digit in ...
user avatar
0 votes
1 answer
33 views

Do While loop not executing for pset3

I am working on Pset3 for a binary search algorithm. Below is my code (NOTE: the logic is not finished): bool search(int value, int values[], int n) { //binary search algorithm int min = 0; int max = ...
user avatar
  • 70
0 votes
1 answer
227 views

Greedy; Pset 1 - Trouble creating modulo algorithm

int q=coins/25; //gives number of quarters int mq=coins%25; gives modulo quarters int md=mq/10; int mn=md/5; int mp=mn/1; printf("%d, %d, %d, %d,", q+md+mn+mp); So I've been able to prompt the user ...
user avatar