Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added quick sort in C# #468

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified Data Structures/Stack/C++/Test/test
100755 → 100644
Empty file.
76 changes: 38 additions & 38 deletions Data Structures/Stack/Python/stack.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
class Stack:
def __init__(self, size = 1000000):
self.stack = []
self.stack_size = size
# Add element to stack
def push(self, element):
# Checking stack is full or not
if len(self.stack) <= self.stack_size:
self.stack.append(element)
else:
print('Stack Full. Overflow')
# Delete element from stack
def pop(self):
if len(self.stack) == 0:
print('Empty Stack. Underflow')
else:
self.stack.pop()
# Returns top element of stack
def top(self):
return self.stack[-1]
# Driver Program
if __name__ == '__main__':
stack = Stack()
stack.pop()
stack.push(1)
stack.push(2)
stack.push(3)
print(stack.top())
stack.pop()
print(stack.top())


class Stack:

def __init__(self, size = 1000000):
self.stack = []
self.stack_size = size

# Add element to stack
def push(self, element):
# Checking stack is full or not
if len(self.stack) <= self.stack_size:
self.stack.append(element)
else:
print('Stack Full. Overflow')

# Delete element from stack
def pop(self):
if len(self.stack) == 0:
print('Empty Stack. Underflow')
else:
self.stack.pop()

# Returns top element of stack
def top(self):
return self.stack[-1]


# Driver Program
if __name__ == '__main__':
stack = Stack()
stack.pop()
stack.push(1)
stack.push(2)
stack.push(3)
print(stack.top())
stack.pop()
print(stack.top())
56 changes: 28 additions & 28 deletions Dynamic Programming/Fibonacci Sequence/Fibonacci_series.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# Program to display the Fibonacci sequence up to n-th term where n is provided by the user
# change this value for a different result
nterms = int (input("enter the no. of terms " ))
# uncomment to take input from the user
#nterms = int(input("How many terms? "))
# first two terms
n1 = 0
n2 = 1
count = 0
# check if the number of terms is valid
if nterms <= 0:
print("Please enter a positive integer")
elif nterms == 1:
print("Fibonacci sequence upto",nterms,":")
print(n1)
else:
print("Fibonacci sequence upto",nterms,":")
while count < nterms:
print(n1,end=' , ')
nth = n1 + n2
# update values
n1 = n2
n2 = nth
count += 1
# Program to display the Fibonacci sequence up to n-th term where n is provided by the user

# change this value for a different result
nterms = int (input("enter the no. of terms " ))

# uncomment to take input from the user
#nterms = int(input("How many terms? "))

# first two terms
n1 = 0
n2 = 1
count = 0

# check if the number of terms is valid
if nterms <= 0:
print("Please enter a positive integer")
elif nterms == 1:
print("Fibonacci sequence upto",nterms,":")
print(n1)
else:
print("Fibonacci sequence upto",nterms,":")
while count < nterms:
print(n1,end=' , ')
nth = n1 + n2
# update values
n1 = n2
n2 = nth
count += 1
10 changes: 5 additions & 5 deletions Dynamic Programming/jan-ken-puzzle/python/test/heavy/01.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
4 4
2 3 3 3
1 3 2 3
2 2 1 2
1 2 1 1
4 4
2 3 3 3
1 3 2 3
2 2 1 2
1 2 1 1
10 changes: 5 additions & 5 deletions Dynamic Programming/jan-ken-puzzle/python/test/heavy/02.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
4 5
1 1 2 2 1
1 3 1 1 1
3 3 1 3 3
0 0 3 2 0
4 5
1 1 2 2 1
1 3 1 1 1
3 3 1 3 3
0 0 3 2 0
10 changes: 5 additions & 5 deletions Dynamic Programming/jan-ken-puzzle/python/test/heavy/03.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
4 5
1 2 1 3 1
2 2 3 3 1
2 1 3 0 3
1 1 1 0 2
4 5
1 2 1 3 1
2 2 3 3 1
2 1 3 0 3
1 1 1 0 2
10 changes: 5 additions & 5 deletions Dynamic Programming/jan-ken-puzzle/python/test/heavy/04.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
4 5
2 3 1 3 1
3 1 2 2 2
2 3 1 3 2
1 3 2 1 0
4 5
2 3 1 3 1
3 1 2 2 2
2 3 1 3 2
1 3 2 1 0
10 changes: 5 additions & 5 deletions Dynamic Programming/jan-ken-puzzle/python/test/heavy/05.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
4 5
3 1 2 2 1
1 2 2 2 1
1 2 1 1 3
3 1 3 3 2
4 5
3 1 2 2 1
1 2 2 2 1
1 2 1 1 3
3 1 3 3 2
12 changes: 6 additions & 6 deletions Dynamic Programming/jan-ken-puzzle/python/test/heavy/06.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
5 5
2 3 3 3 2
2 3 2 3 2
0 1 2 2 2
0 2 2 1 1
0 1 0 3 1
5 5
2 3 3 3 2
2 3 2 3 2
0 1 2 2 2
0 2 2 1 1
0 1 0 3 1
10 changes: 5 additions & 5 deletions Dynamic Programming/jan-ken-puzzle/python/test/heavy/07.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
4 6
1 3 2 3 3 0
3 2 2 3 1 3
1 2 2 3 2 0
1 2 1 3 3 2
4 6
1 3 2 3 3 0
3 2 2 3 1 3
1 2 2 3 2 0
1 2 1 3 3 2
8 changes: 4 additions & 4 deletions Dynamic Programming/jan-ken-puzzle/python/test/heavy/08.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
3 8
1 3 3 1 1 1 1 0
1 3 2 2 1 1 2 3
3 2 2 2 3 2 1 1
3 8
1 3 3 1 1 1 1 0
1 3 2 2 1 1 2 3
3 2 2 2 3 2 1 1
8 changes: 4 additions & 4 deletions Dynamic Programming/jan-ken-puzzle/python/test/heavy/09.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
3 8
3 3 3 3 1 3 1 3
2 2 2 1 3 3 1 0
1 3 2 3 3 1 1 2
3 8
3 3 3 3 1 3 1 3
2 2 2 1 3 3 1 0
1 3 2 3 3 1 1 2
6 changes: 3 additions & 3 deletions Dynamic Programming/jan-ken-puzzle/python/test/heavy/10.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2 3
0 0 3
2 3 3
2 3
0 0 3
2 3 3
10 changes: 5 additions & 5 deletions Dynamic Programming/jan-ken-puzzle/python/test/light/01.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
4 4
1 0 0 0
2 3 2 1
2 2 2 1
2 2 2 2
4 4
1 0 0 0
2 3 2 1
2 2 2 1
2 2 2 2
10 changes: 5 additions & 5 deletions Dynamic Programming/jan-ken-puzzle/python/test/light/02.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
4 4
2 1 3 3
0 3 3 1
0 3 1 2
1 2 1 1
4 4
2 1 3 3
0 3 3 1
0 3 1 2
1 2 1 1
10 changes: 5 additions & 5 deletions Dynamic Programming/jan-ken-puzzle/python/test/light/03.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
4 4
1 1 1 3
1 2 2 2
2 2 1 1
2 2 1 0
4 4
1 1 1 3
1 2 2 2
2 2 1 1
2 2 1 0
10 changes: 5 additions & 5 deletions Dynamic Programming/jan-ken-puzzle/python/test/light/04.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
4 4
1 2 1 3
2 3 2 1
2 2 1 3
2 3 3 2
4 4
1 2 1 3
2 3 2 1
2 2 1 3
2 3 3 2
10 changes: 5 additions & 5 deletions Dynamic Programming/jan-ken-puzzle/python/test/light/05.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
4 5
2 0 2 0 2
3 3 1 1 3
3 2 3 3 3
3 3 3 2 0
4 5
2 0 2 0 2
3 3 1 1 3
3 2 3 3 3
3 3 3 2 0
10 changes: 5 additions & 5 deletions Dynamic Programming/jan-ken-puzzle/python/test/light/06.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
4 5
1 1 2 2 1
3 2 3 1 3
0 3 3 1 3
2 1 1 2 0
4 5
1 1 2 2 1
3 2 3 1 3
0 3 3 1 3
2 1 1 2 0
8 changes: 4 additions & 4 deletions Dynamic Programming/jan-ken-puzzle/python/test/light/07.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
3 8
0 1 3 1 1 2 2 2
0 2 2 3 1 1 1 2
0 0 0 2 1 2 1 1
3 8
0 1 3 1 1 2 2 2
0 2 2 3 1 1 1 2
0 0 0 2 1 2 1 1
6 changes: 3 additions & 3 deletions Dynamic Programming/jan-ken-puzzle/python/test/light/08.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2 11
1 1 1 2 3 2 2 2 1 0 0
2 1 1 3 2 2 3 3 3 3 2
2 11
1 1 1 2 3 2 2 2 1 0 0
2 1 1 3 2 2 3 3 3 3 2
6 changes: 3 additions & 3 deletions Dynamic Programming/jan-ken-puzzle/python/test/light/09.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2 11
0 2 1 3 2 1 1 1 1 3 3
2 3 2 2 2 2 3 3 3 1 2
2 11
0 2 1 3 2 1 1 1 1 3 3
2 3 2 2 2 2 3 3 3 1 2
6 changes: 3 additions & 3 deletions Dynamic Programming/jan-ken-puzzle/python/test/light/10.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2 3
0 0 3
2 3 3
2 3
0 0 3
2 3 3
56 changes: 28 additions & 28 deletions Fibonacci_series.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# Program to display the Fibonacci sequence up to n-th term where n is provided by the user
# change this value for a different result
nterms = int (input("enter the no. of terms " ))
# uncomment to take input from the user
#nterms = int(input("How many terms? "))
# first two terms
n1 = 0
n2 = 1
count = 0
# check if the number of terms is valid
if nterms <= 0:
print("Please enter a positive integer")
elif nterms == 1:
print("Fibonacci sequence upto",nterms,":")
print(n1)
else:
print("Fibonacci sequence upto",nterms,":")
while count < nterms:
print(n1,end=' , ')
nth = n1 + n2
# update values
n1 = n2
n2 = nth
count += 1
# Program to display the Fibonacci sequence up to n-th term where n is provided by the user

# change this value for a different result
nterms = int (input("enter the no. of terms " ))

# uncomment to take input from the user
#nterms = int(input("How many terms? "))

# first two terms
n1 = 0
n2 = 1
count = 0

# check if the number of terms is valid
if nterms <= 0:
print("Please enter a positive integer")
elif nterms == 1:
print("Fibonacci sequence upto",nterms,":")
print(n1)
else:
print("Fibonacci sequence upto",nterms,":")
while count < nterms:
print(n1,end=' , ')
nth = n1 + n2
# update values
n1 = n2
n2 = nth
count += 1
Empty file modified Java Design Patterns/AbstractFactory/App.java
100755 → 100644
Empty file.
Empty file modified Java Design Patterns/AbstractFactory/FactoryCar.java
100755 → 100644
Empty file.
Empty file modified Java Design Patterns/AbstractFactory/GMCFactory.java
100755 → 100644
Empty file.
Empty file modified Java Design Patterns/AbstractFactory/Minivan.java
100755 → 100644
Empty file.
Empty file modified Java Design Patterns/AbstractFactory/Pickup.java
100755 → 100644
Empty file.
Empty file modified Java Design Patterns/AbstractFactory/Savana.java
100755 → 100644
Empty file.
Empty file modified Java Design Patterns/AbstractFactory/Sienna.java
100755 → 100644
Empty file.
Empty file modified Java Design Patterns/AbstractFactory/Sierra.java
100755 → 100644
Empty file.
Empty file modified Java Design Patterns/AbstractFactory/Tacoma.java
100755 → 100644
Empty file.
Empty file modified Java Design Patterns/AbstractFactory/ToyotaFactory.java
100755 → 100644
Empty file.
Empty file modified Java Design Patterns/AbstractFactory/readme.md
100755 → 100644
Empty file.
Loading