# Questions tagged [algorithm]

The tag has no usage guidance.

10 questions
Filter by
Sorted by
Tagged with
892 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 ...
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.
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 = ...
98 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 ...
38 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 ...
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 ...
19 views

### PSET 3 Plurality Print_winner function prints smallest number of votes too many times (sorting algorithm?)

I am doing Problem Set 3 Plurality. I am currently on the print_winner function. My program compiles but I'm having issues because it does not print the winner and any ties it prints whoever got the ...
58 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 ...