Git Product home page Git Product logo

mostafa-saad / arabiccompetitiveprogramming Goto Github PK

View Code? Open in Web Editor NEW
1.4K 96.0 531.0 107.16 MB

The repository contains the ENGLISH description files attached to the video series in my ARABIC algorithms channel.

Home Page: https://www.youtube.com/user/nobody123497

C++ 98.23% HTML 1.77%
algorithm acm-icpc competitive-programming arabic youtube data-structures training-materials library

arabiccompetitiveprogramming's Introduction

ArabicCompetitiveProgramming

The repository will contain the description files attached to the video series in my algorithms channel.

arabiccompetitiveprogramming's People

Contributors

mahmoudelwsef avatar mostafa-saad avatar wasim7raja10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arabiccompetitiveprogramming's Issues

Questions about Segments Intersection

In this code:
https://github.com/mostafa-saad/ArabicCompetitiveProgramming/blob/master/04%20Math/Computational_Geometry_12_Line_Sweep_2_Segments_Intersection.cpp
When I use the code, I use this case:
5
1 1 3 3
1 2 3 2
1 3 3 1
-1 -1 2 3
0 -2 1 4
It should give six intersections(although 4 different) , but it only gives five(3 different):
5 4
2 1
3 2
4 3
3 1

The ignored one should be '2 4'. I can just find the problem, but I don't know how to deal with it. Could you give me some advice?

Updating Lazy Delete method in Employee Code

Problem :

ArabicCompetitiveProgramming/18-Programming-4kids/11_homework_10_answer_employees_v1.cpp

Here is my code without Lazy Delete Method:

#include
#include
#include
using namespace std;

const int MAX = 50;

int salary[MAX];
int age[MAX];
char gendrL[MAX];
string name[MAX];
int added = 0;

int main() {
while (true)
{
int choice = -1;
cout << "\n1) Add Employee Data \n";
cout << "2) Print All Employees \n";
cout << "3) Remove employee by age \n";
cout << "4) Update Employee salary \n\n";

	cin >> choice;
	
	while (choice < 1 || 4 < choice)
	{
		cout << "Invalid Choice. \n";
		cin >> choice;
	}

	switch (choice)
	{
	case 1:
		cout << "Enter  Name, Age, Salary, and Gender Letter(M/F) :   ";
		cin >> name[added] >> age[added] >> salary[added] >> gendrL[added];
		added++;
		break;
	case 2:
		cout << setw(10) << "NAME" << setw(12) << "Salary" << setw(10) << "Age" << setw(10) << "Gender" << "\n";
		for (int i = 0; i < 45; i++)
			cout << '-';
		cout << endl;

		for (int i = 0; i < added; i++) {
			cout << i + 1 << setw(10) << name[i] << setw(10) << salary[i] << setw(10) << age[i] << setw(10) << gendrL[i] << "\n";
		}
		break;
	case 3:
		int start, end;
		cout << "Enter Starting and Ending age:  ";
		cin >> start >> end;
		for (int i = 0; i < added; i++)
		{
			if (age[i] <= end && age[i] >= start) {
				for (int j = i; j < added; j++)
				{
					age[j] = age[j + 1];
					name[j] = name[j + 1];
					salary[j] = salary[j + 1];
					gendrL[j] = gendrL[j + 1];
				}
				added--;
				i--;
			}
		}
		break;
	
	case 4:
		string updateName;
		int updateSalary;
		int oldSalary = 0;
		cout << "Enter Employee Name, and Updated Salary:	";
		cin >> updateName >> updateSalary;

		for (int i = 0; i < added; i++)
			if (name[i] == updateName){
				oldSalary = salary[i];
				salary[i] = updateSalary;
			}
		break;
	}
}

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.