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

Reorganized the directory for better navigation #79

Merged
merged 1 commit into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
File renamed without changes.
45 changes: 0 additions & 45 deletions Java Codes/JosephusProblem.java

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
100 changes: 50 additions & 50 deletions Java Codes/_1ErrorAndException.java → Java/_1ErrorAndException.java
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
package _14ErrorAndException;
import java.util.Scanner;
public class _1ErrorAndException {
public static void main(String[] args) {
/*
There are 3 type of error
1. Syntax error
2. Logical error
3. Runtime error
*/
// 1. Synatx error
/*
try {
a = 10;
int b = 4
System.out.println(a+d);
} catch (Exception e) {
System.out.println(e);
}
*/
// 2.Logical error
/*write a program to print all prime number between 1 and 10 but 9 is not prime,
that means we implement wrong logic */
/*
System.out.println(2);
for (int i = 1; i < 5; i++) {
System.out.println(2 * i + 1);
}
*/
// 3. Runtime Error---> Exception error
/* here a variable is must integer, if is not int then we will get runtime error
so this type of error we can handle using try, catch and finally block
*/
System.out.print("Enter the number: ");
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
System.out.println("Calculation is " + 1000 / a);
}
}
package _14ErrorAndException;

import java.util.Scanner;

public class _1ErrorAndException {
public static void main(String[] args) {
/*
There are 3 type of error
1. Syntax error
2. Logical error
3. Runtime error
*/

// 1. Synatx error
/*
try {
a = 10;
int b = 4
System.out.println(a+d);

} catch (Exception e) {
System.out.println(e);
}
*/


// 2.Logical error
/*write a program to print all prime number between 1 and 10 but 9 is not prime,
that means we implement wrong logic */

/*
System.out.println(2);
for (int i = 1; i < 5; i++) {
System.out.println(2 * i + 1);
}
*/

// 3. Runtime Error---> Exception error
/* here a variable is must integer, if is not int then we will get runtime error
so this type of error we can handle using try, catch and finally block
*/
System.out.print("Enter the number: ");
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();

System.out.println("Calculation is " + 1000 / a);


}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 26 additions & 26 deletions BubbleSort.py → Python/BubbleSort.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Bubble sort in Python
def bubbleSort(array):
# loop to access each array element
for i in range(len(array)):
# loop to compare array elements
for j in range(0, len(array) - i - 1):
# compare two adjacent elements
# change > to < to sort in descending order
if array[j] > array[j + 1]:
# swapping elements if elements
# are not in the intended order
temp = array[j]
array[j] = array[j+1]
array[j+1] = temp
data = [-2, 45, 0, 11, -9]
bubbleSort(data)
print('Sorted Array in Ascending Order:')
# Bubble sort in Python

def bubbleSort(array):

# loop to access each array element
for i in range(len(array)):

# loop to compare array elements
for j in range(0, len(array) - i - 1):

# compare two adjacent elements
# change > to < to sort in descending order
if array[j] > array[j + 1]:

# swapping elements if elements
# are not in the intended order
temp = array[j]
array[j] = array[j+1]
array[j+1] = temp


data = [-2, 45, 0, 11, -9]

bubbleSort(data)

print('Sorted Array in Ascending Order:')
print(data)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 0 additions & 32 deletions Sorting_Algorithms/Bubble_sort.py

This file was deleted.

57 changes: 0 additions & 57 deletions Sorting_Algorithms/Merge_sort.py

This file was deleted.

34 changes: 0 additions & 34 deletions Sorting_Algorithms/Selection_sort.py

This file was deleted.

33 changes: 0 additions & 33 deletions binary_search/binary_search.cpp

This file was deleted.