allalgorithms / c Goto Github PK
View Code? Open in Web Editor NEWImplementation of All ▲lgorithms in C Programming Language
Home Page: https://github.com/AllAlgorithms/c
License: MIT License
Implementation of All ▲lgorithms in C Programming Language
Home Page: https://github.com/AllAlgorithms/c
License: MIT License
I have to write a program to print two
Salaries one as the basic and the other with bonus according to the days if he had worked for days above 25 he'll get bonus other wise he'll not and the one who get bonus will get 1000 per day for each day starting from 25 to the day till 31 like if he came 26 days he'll get 1000 bonus and if 27 he'll get 2000 and so on till 31
The user will input the basic salary and the days which he worked
There are 9 outstanding pull requests. Can they please be reviewed and merged in a timely manner?
This issue is: A typo error in README.md
Description:
There was a typo in README.md (Should be "searching" instead of "serching").
I'm a student and I wish to start learning c
I am creating an issue because I want to add Contribution Guidelines for @AllAlgorithms.
It's a famous and interesting question on dynamic programming , I think adding it to this repo will be good
I stuck into this topic from last one and half months..can any1 explain it here in simple order.. vthout makin things complicated. 🤧
I am creating an issue because...i donot know how we contribute in this repository for making repo better and enhance my knowledge.
Hi, everyone!
Do you know any algorithm implementation in any language, that you wanna share with us?
Open a pull request in any of the programming languages available, or in C this case
Please find out the errors and tell me it's urgent.
#include <stdio.h>
#include <string.h>
#define MAX_STUDENTS 50
// Structure for student data
struct Student {
int regNo;
char name[50];
char branch[50];
float cgpa;
};
// Linear search function to find a student by registration number
void linearSearch(struct Student students[], int size, int regNo) {
int found = 0;
for (int i = 0; i < size; i++) {
if (students[i].regNo == regNo) {
printf("Student found:\n");
printf("Reg No: %d\n", students[i].regNo);
printf("Name: %s\n", students[i].name);
printf("Branch: %s\n", students[i].branch);
printf("CGPA: %.2f\n", students[i].cgpa);
found = 1;
break;
}
}
if (!found) {
printf("Student not found!\n");
}
}
// Bubble sort function to arrange students data by registration number
void bubbleSort(struct Student students[], int size) {
for (int i = 0; i < size - 1; i++) {
for (int j = 0; j < size - i - 1; j++) {
if (students[j].regNo > students[j + 1].regNo) {
// Swap students
struct Student temp = students[j];
students[j] = students[j + 1];
students[j + 1] = temp;
}
}
}
}
// Binary search function to find a student by registration number (requires data to be sorted)
void binarySearch(struct Student students[], int size, int regNo) {
int left = 0;
int right = size - 1;
int found = 0;
while (left <= right) {
int mid = left + (right - left) / 2;
if (students[mid].regNo == regNo) {
printf("Student found:\n");
printf("Reg No: %d\n", students[mid].regNo);
printf("Name: %s\n", students[mid].name);
printf("Branch: %s\n", students[mid].branch);
printf("CGPA: %.2f\n", students[mid].cgpa);
found = 1;
break;
}
else if (students[mid].regNo < regNo) {
left = mid + 1;
}
else {
right = mid - 1;
}
}
if (!found) {
printf("Student not found!\n");
}
}
// Insertion sort function to arrange students data by CGPA in descending order
void insertionSort(struct Student students[], int size) {
for (int i = 1; i < size; i++) {
struct Student key = students[i];
int j = i - 1;
while (j >= 0 && students[j].cgpa < key.cgpa) {
students[j + 1] = students[j];
j = j - 1;
}
students[j + 1] = key;
}
}
int main() {
struct Student students[MAX_STUDENTS] = {
{ 1001, "John", "Computer Science", 8.5 },
// Add remaining student data
// ...
};
int regNoToSearch = 1003;
// Linear search
linearSearch(students, MAX_STUDENTS, regNoToSearch);
// Bubble sort by registration number
bubbleSort(students, MAX_STUDENTS);
// Binary search after sorting
binarySearch(students, MAX_STUDENTS, regNoToSearch);
// Insertion sort by CGPA in descending order
insertionSort(students, MAX_STUDENTS);
return 0;
}
Thanks for anyone contributing to this project. It's been a huge the amount of work, and many, many algorithms over the pass year. I would like to start converting the All ▲lgorithms Project to a library to make it more useful and even more reusable.
We could have all the algorithms inside an /algorithms
folder and keep start creating an evaluating the algorithm on the library from those algorithms already implemented. I know its a huge work but we can accomplish it together.
We will use clib a package manager for C developers. I will be more flexible on pull request right now to let people contribute on the project, and also remove some outgoing PRs, but eventually they will be as mentioned earlier on the /algorithms
folder.
So have an amazing 2020 folks!
I am creating an issue for making a folder for Codechef solutions
Hi, everyone!
Do you know any algorithm implementation in any language, that you wanna share with us?
Open a pull request in any of the programming languages available, or in C this case
Working on it.
I have to write a program to print two
Salaries one as the basic and the other with bonus according to the days if he had worked for days above 25 he'll get bonus other wise he'll not and the one who get bonus will get 1000 per day for each day starting from 25 to the day till 31 like if he came 26 days he'll get 1000 bonus and if 27 he'll get 2000 and so on till 31
The user will input the basic salary and the days which he worked
I am creating an issue because the next permutation function in cpp can be easily made using built-in functions, but in c, it is not so easy. So I want to add this new algorithm here for this question :
https://leetcode.com/problems/next-permutation/
I want to make this contribution under Hacktoberfest'22.
And I will include this file in strings directory.
A
What is the the syntax of using function
There in no tree traversal program.
So, kindly add tree traversal program.
#wanted
Algorithms pertaining to operating system are very much a core part of all algorithms that any person dealing with computer science and programming should have an idea about.
Algorithms for process scheduling(like fcfs etc), disk scheduling(like scan), deadlock avoidance(like bankers) should also be implemented.
This issue is:
Description:
This issue is:
Description:
I am creating an issue because...
I can make algorithm using java
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.