Skip to content

Latest commit

 

History

History
68 lines (51 loc) · 3.33 KB

README.md

File metadata and controls

68 lines (51 loc) · 3.33 KB

Algorithms1

introduction

In the Algorithms 1 course at Ariel University we study a number of algorithms. this project brings all the implementations of this course.

AliceBob:

The problem Alice and Bob represent a problem where two players play a guessing game in which they have to toss a coin and guess what came out of the toss to the other player, this algorithm brings all the possibilities for the success of the game.

MinMaxAlgorithms:

In this algorithm I bring all the good and least good options to find minimum and maximum in the array.

Parking problem:

In this problem I bring an algorithm for counting cars in a circular parking lot when we do not know where we started the count.

Rabbit_Tertel:

In this algorithm we check whether a particular list is circular or not.

LinkedList_withArm:

In this algorithm we check if a particular list has a non-circular start and a circular end.

Recursion_loop:

This class gives some examples of functions realized by recursion or loop, and their priority.

NumberGame problem:

This class represents the problem of numbers game, where players are given an even array of numbers and in each turn they can take either the outer left or the outer right, the winner is the one whose sum of numbers is the largest.

Median problem:

This algorithm is divided into two parts:

  • Algorithm for solving a median problem in which the user receives an array and has to return an organ larger than the median.
  • An algorithm for solving the median problem in which the user receives two sorted arrays and must return an array with all the larger safflowers from the common median to the two combined arrays.

Secretary problem:

This department represents the problem of the secretary, the problem is: a certain office gives service to n clients, the purpose of the secretary is to reduce as much as possible the average time that the clients are in the office. We see that the average time is smaller when the other adjacent treatment times are in ascending order.

Pizza problem:

This class presents an algorithm for solving the pizza problem. The pizza problem: Two brothers ordered a family pizza, one brother eating X times faster than the other brother eating. The two must not reach the last triangle at the same time, this algorithm offers the optimal pizza distribution.

Lcs:

This class represents an algorithm for solving the LCS problem - finding the largest common string (order is important, sequences are not important).

Lis:

This class represents an algorithm for solving the LIS problem - finding the longest rising sub-series (order is important, sequences are not important).

Plane problem:

This class represents the problem of the plane, the plane must reach from point (0,0) to point (m, n) at the minimum cost, while the rest of the plane is allowed to move down and to the right.

Prisoners problem:

This class represents the solution to the prisoners' problem, if the light is on and if not.

Fibonacci problem:

This class represents the way to solve Fibonacci problem with complexity of O(log n).

Power problem:

This class represents the way to compute a power with complexity of O(log n).

Donuts problem

This class represents the problem of donuts, how long does it take to cook many donuts on one pan with a certain capacity