
18 | 
19 | 
20 | 
21 | 
22 | 
23 | 
24 | 
25 |
26 | **My Dream Companies:**
27 | 
29 | 
30 | 
31 | 
32 | 
33 | 
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Merge sort by python:
--------------------------------------------------------------------------------
1 | # Python program for implementation of MergeSort
2 |
3 |
4 | # Merges two subarrays of arr[].
5 | # First subarray is arr[l..m]
6 | # Second subarray is arr[m+1..r]
7 |
8 | def merge(arr, l, m, r):
9 |
10 | n1 = m - l + 1
11 |
12 | n2 = r- m
13 |
14 |
15 |
16 | # create temp arrays
17 |
18 | L = [0] * (n1)
19 |
20 | R = [0] * (n2)
21 |
22 |
23 |
24 | # Copy data to temp arrays L[] and R[]
25 |
26 | for i in range(0 , n1):
27 |
28 | L[i] = arr[l + i]
29 |
30 |
31 |
32 | for j in range(0 , n2):
33 |
34 | R[j] = arr[m + 1 + j]
35 |
36 |
37 |
38 | # Merge the temp arrays back into arr[l..r]
39 |
40 | i = 0 # Initial index of first subarray
41 |
42 | j = 0 # Initial index of second subarray
43 |
44 | k = l # Initial index of merged subarray
45 |
46 |
47 |
48 | while i < n1 and j < n2 :
49 |
50 | if L[i] <= R[j]:
51 |
52 | arr[k] = L[i]
53 |
54 | i += 1
55 |
56 | else:
57 |
58 | arr[k] = R[j]
59 |
60 | j += 1
61 |
62 | k += 1
63 |
64 |
65 |
66 | # Copy the remaining elements of L[], if there
67 |
68 | # are any
69 |
70 | while i < n1:
71 |
72 | arr[k] = L[i]
73 |
74 | i += 1
75 |
76 | k += 1
77 |
78 |
79 |
80 | # Copy the remaining elements of R[], if there
81 |
82 | # are any
83 |
84 | while j < n2:
85 |
86 | arr[k] = R[j]
87 |
88 | j += 1
89 |
90 | k += 1
91 |
92 |
93 | # l is for left index and r is right index of the
94 | # sub-array of arr to be sorted
95 |
96 | def mergeSort(arr,l,r):
97 |
98 | if l < r:
99 |
100 |
101 |
102 | # Same as (l+r)//2, but avoids overflow for
103 |
104 | # large l and h
105 |
106 | m = (l+(r-1))//2
107 |
108 |
109 |
110 | # Sort first and second halves
111 |
112 | mergeSort(arr, l, m)
113 |
114 | mergeSort(arr, m+1, r)
115 |
116 | merge(arr, l, m, r)
117 |
118 |
119 |
120 |
121 | # Driver code to test above
122 |
123 | arr = [12, 11, 13, 5, 6, 7]
124 |
125 | n = len(arr)
126 |
127 | print ("Given array is")
128 |
129 | for i in range(n):
130 |
131 | print ("%d" %arr[i]),
132 |
133 |
134 |
135 | mergeSort(arr,0,n-1)
136 |
137 | print ("\n\nSorted array is")
138 |
139 | for i in range(n):
140 |
141 | print ("%d" %arr[i]),
142 |
143 |
144 |
--------------------------------------------------------------------------------
/Mergesort:
--------------------------------------------------------------------------------
1 | class MergeSort {
2 | // Merges two subarrays of arr[].
3 | // First subarray is arr[l..m]
4 | // Second subarray is arr[m+1..r]
5 | void merge(int arr[], int l, int m, int r)
6 | {
7 | // Find sizes of two subarrays to be merged
8 | int n1 = m - l + 1;
9 | int n2 = r - m;
10 |
11 | /* Create temp arrays */
12 | int L[] = new int[n1];
13 | int R[] = new int[n2];
14 |
15 | /*Copy data to temp arrays*/
16 | for (int i = 0; i < n1; ++i)
17 | L[i] = arr[l + i];
18 | for (int j = 0; j < n2; ++j)
19 | R[j] = arr[m + 1 + j];
20 |
21 | /* Merge the temp arrays */
22 |
23 | // Initial indexes of first and second subarrays
24 | int i = 0, j = 0;
25 |
26 | // Initial index of merged subarry array
27 | int k = l;
28 | while (i < n1 && j < n2) {
29 | if (L[i] <= R[j]) {
30 | arr[k] = L[i];
31 | i++;
32 | }
33 | else {
34 | arr[k] = R[j];
35 | j++;
36 | }
37 | k++;
38 | }
39 |
40 | /* Copy remaining elements of L[] if any */
41 | while (i < n1) {
42 | arr[k] = L[i];
43 | i++;
44 | k++;
45 | }
46 |
47 | /* Copy remaining elements of R[] if any */
48 | while (j < n2) {
49 | arr[k] = R[j];
50 | j++;
51 | k++;
52 | }
53 | }
54 |
55 | // Main function that sorts arr[l..r] using
56 | // merge()
57 | void sort(int arr[], int l, int r)
58 | {
59 | if (l < r) {
60 | // Find the middle point
61 | int m = (l + r) / 2;
62 |
63 | // Sort first and second halves
64 | sort(arr, l, m);
65 | sort(arr, m + 1, r);
66 |
67 | // Merge the sorted halves
68 | merge(arr, l, m, r);
69 | }
70 | }
71 |
72 | /* A utility function to print array of size n */
73 | static void printArray(int arr[])
74 | {
75 | int n = arr.length;
76 | for (int i = 0; i < n; ++i)
77 | System.out.print(arr[i] + " ");
78 | System.out.println();
79 | }
80 |
81 | // Driver method
82 | public static void main(String args[])
83 | {
84 | int arr[] = { 12, 11, 13, 5, 6, 7 };
85 |
86 | System.out.println("Given Array");
87 | printArray(arr);
88 |
89 | MergeSort ob = new MergeSort();
90 | ob.sort(arr, 0, arr.length - 1);
91 |
92 | System.out.println("\nSorted array");
93 | printArray(arr);
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/Pygame:
--------------------------------------------------------------------------------
1 | import pygame
2 | import random
3 | import sys
4 |
5 | pygame.init()
6 |
7 | WIDTH = 800
8 | HEIGHT = 600
9 |
10 | RED = (255,0,0)
11 | BLUE = (0,0,255)
12 | YELLOW = (255,255,0)
13 | BACKGROUND_COLOR = (0,0,0)
14 |
15 | player_size = 50
16 | player_pos = [WIDTH/2, HEIGHT-2*player_size]
17 |
18 | enemy_size = 50
19 | enemy_pos = [random.randint(0,WIDTH-enemy_size), 0]
20 | enemy_list = [enemy_pos]
21 |
22 | SPEED = 10
23 |
24 | screen = pygame.display.set_mode((WIDTH, HEIGHT))
25 |
26 | game_over = False
27 |
28 | score = 0
29 |
30 | clock = pygame.time.Clock()
31 |
32 | myFont = pygame.font.SysFont("monospace", 35)
33 |
34 | def set_level(score, SPEED):
35 | if score < 20:
36 | SPEED = 5
37 | elif score < 40:
38 | SPEED = 8
39 | elif score < 60:
40 | SPEED = 12
41 | else:
42 | SPEED = 15
43 | return SPEED
44 | # SPEED = score/5 + 1
45 |
46 |
47 | def drop_enemies(enemy_list):
48 | delay = random.random()
49 | if len(enemy_list) < 10 and delay < 0.1:
50 | x_pos = random.randint(0,WIDTH-enemy_size)
51 | y_pos = 0
52 | enemy_list.append([x_pos, y_pos])
53 |
54 | def draw_enemies(enemy_list):
55 | for enemy_pos in enemy_list:
56 | pygame.draw.rect(screen, BLUE, (enemy_pos[0], enemy_pos[1], enemy_size, enemy_size))
57 |
58 | def update_enemy_positions(enemy_list, score):
59 | for idx, enemy_pos in enumerate(enemy_list):
60 | if enemy_pos[1] >= 0 and enemy_pos[1] < HEIGHT:
61 | enemy_pos[1] += SPEED
62 | else:
63 | enemy_list.pop(idx)
64 | score += 1
65 | return score
66 |
67 | def collision_check(enemy_list, player_pos):
68 | for enemy_pos in enemy_list:
69 | if detect_collision(enemy_pos, player_pos):
70 | return True
71 | return False
72 |
73 | def detect_collision(player_pos, enemy_pos):
74 | p_x = player_pos[0]
75 | p_y = player_pos[1]
76 |
77 | e_x = enemy_pos[0]
78 | e_y = enemy_pos[1]
79 |
80 | if (e_x >= p_x and e_x < (p_x + player_size)) or (p_x >= e_x and p_x < (e_x+enemy_size)):
81 | if (e_y >= p_y and e_y < (p_y + player_size)) or (p_y >= e_y and p_y < (e_y+enemy_size)):
82 | return True
83 | return False
84 |
85 | while not game_over:
86 |
87 | for event in pygame.event.get():
88 | if event.type == pygame.QUIT:
89 | sys.exit()
90 |
91 | if event.type == pygame.KEYDOWN:
92 |
93 | x = player_pos[0]
94 | y = player_pos[1]
95 |
96 | if event.key == pygame.K_LEFT:
97 | x -= player_size
98 | elif event.key == pygame.K_RIGHT:
99 | x += player_size
100 |
101 | player_pos = [x,y]
102 |
103 | screen.fill(BACKGROUND_COLOR)
104 |
105 | drop_enemies(enemy_list)
106 | score = update_enemy_positions(enemy_list, score)
107 | SPEED = set_level(score, SPEED)
108 |
109 | text = "Score:" + str(score)
110 | label = myFont.render(text, 1, YELLOW)
111 | screen.blit(label, (WIDTH-200, HEIGHT-40))
112 |
113 | if collision_check(enemy_list, player_pos):
114 | game_over = True
115 | break
116 |
117 | draw_enemies(enemy_list)
118 |
119 | pygame.draw.rect(screen, RED, (player_pos[0], player_pos[1], player_size, player_size))
120 |
121 | clock.tick(30)
122 |
123 | pygame.display.update()
124 |
--------------------------------------------------------------------------------
/Car Gmae:
--------------------------------------------------------------------------------
1 | import pygame
2 | import time
3 | import random
4 |
5 | pygame.init()
6 |
7 | display_width = 800
8 | display_height = 600
9 |
10 | black = (0,0,0)
11 | white = (255,255,255)
12 | red = (255,0,0)
13 |
14 | car_width = 73
15 |
16 | gameDisplay = pygame.display.set_mode((display_width,display_height))
17 | pygame.display.set_caption('A bit Racey')
18 | clock = pygame.time.Clock()
19 |
20 | carImg = pygame.image.load('racecar.png')
21 |
22 | def things(thingx, thingy, thingw, thingh, color):
23 | pygame.draw.rect(gameDisplay, color, [thingx, thingy, thingw, thingh])
24 |
25 | def car(x,y):
26 | gameDisplay.blit(carImg,(x,y))
27 |
28 | def text_objects(text, font):
29 | textSurface = font.render(text, True, black)
30 | return textSurface, textSurface.get_rect()
31 |
32 | def message_display(text):
33 | largeText = pygame.font.Font('freesansbold.ttf',115)
34 | TextSurf, TextRect = text_objects(text, largeText)
35 | TextRect.center = ((display_width/2),(display_height/2))
36 | gameDisplay.blit(TextSurf, TextRect)
37 |
38 | pygame.display.update()
39 |
40 | time.sleep(2)
41 |
42 | game_loop()
43 |
44 |
45 |
46 | def crash():
47 | message_display('You Crashed')
48 |
49 | def game_loop():
50 | x = (display_width * 0.45)
51 | y = (display_height * 0.8)
52 |
53 | x_change = 0
54 |
55 | thing_startx = random.randrange(0, display_width)
56 | thing_starty = -600
57 | thing_speed = 7
58 | thing_width = 100
59 | thing_height = 100
60 |
61 | gameExit = False
62 |
63 | while not gameExit:
64 |
65 | for event in pygame.event.get():
66 | if event.type == pygame.QUIT:
67 | pygame.quit()
68 | quit()
69 |
70 | if event.type == pygame.KEYDOWN:
71 | if event.key == pygame.K_LEFT:
72 | x_change = -5
73 | if event.key == pygame.K_RIGHT:
74 | x_change = 5
75 |
76 | if event.type == pygame.KEYUP:
77 | if event.key == pygame.K_LEFT or event.key == pygame.K_RIGHT:
78 | x_change = 0
79 |
80 | x += x_change
81 | gameDisplay.fill(white)
82 |
83 | # things(thingx, thingy, thingw, thingh, color)
84 | things(thing_startx, thing_starty, thing_width, thing_height, black)
85 | thing_starty += thing_speed
86 | car(x,y)
87 |
88 | if x > display_width - car_width or x < 0:
89 | crash()
90 |
91 | if thing_starty > display_height:
92 | thing_starty = 0 - thing_height
93 | thing_startx = random.randrange(0,display_width)
94 |
95 | ####
96 | if y < thing_starty+thing_height:
97 | print('y crossover')
98 |
99 | if x > thing_startx and x < thing_startx + thing_width or x+car_width > thing_startx and x + car_width < thing_startx+thing_width:
100 | print('x crossover')
101 | crash()
102 | ####
103 |
104 | pygame.display.update()
105 | clock.tick(60)
106 |
107 |
108 | game_loop()
109 | pygame.quit()
110 | quit()
111 |
--------------------------------------------------------------------------------
/Queneusingarray.c:
--------------------------------------------------------------------------------
1 | //As I told yesterday that an interface describes what a data structure does, while an implementation describes how the data structure does it.
2 | //Queue interface ( bol sakta hai right , toh iska interface kaisaa hogaa)
3 | //add(x): add the value x to the Queue
4 | //remove(): remove the next (previously added) value, y, from the Queue and return y
5 | //We can see that the remove() operation takes no argument.
6 | //ow A FIFO (first-in-first-out) Queue,
7 | //removes items in the same order they were added,
8 | //Matlab store mein jo pehle ata hai woh cash payment kar key chala jata hai fine, clear.
9 | //And yeh jo add(x) and remove() operations ho raha hai na on FIFO Queue ise koh he
10 | //enqueue(x) and dequeue(), bolta hai data structure mein understood
11 |
12 | //samjhe gaya na kal jo bola tah interface and implementation okay.
13 |
14 | //Now let us see the implementation
15 |
16 | //Queue Array implementation –
17 |
18 | //Front – The item at the front of the queue is called front item
19 | //Rear – The item at the end of the Queue is called rear item
20 | //Enqueue – Process of adding or inserting a new item in the queue is called as Enqueing
21 | //Dequeueing – Process of removing or deleting an existing item from the queue is called as dequeueing
22 | //Size – The max size of the queue is called as size an is initialised when the queue is created
23 |
24 |
25 | #include|
19 | |
22 |
23 |
24 | |
27 |
28 |
29 | |
32 |
36 |
38 | |
39 |
40 |
41 |
43 | |
44 |
45 |
46 |
48 | |
49 |
53 |
55 | |
56 |
57 |
58 |
60 | |
61 |
62 |
63 |
64 |
65 |
67 | |
68 |
|
72 | |
75 |
76 |
77 | |
80 |
81 |
82 |
84 | |
85 |
3 |
4 |
5 | 
20 | 
21 | 
22 | 
23 | 
24 | 
25 | 
26 | 
27 | 
28 | 
29 | 
30 | 
31 | 
32 | 
33 | 
34 | 
35 | 
36 | 
37 |
38 |
39 | - 🌱 WEB DEVELOPER || PYTHON DEVELOPER
40 | - 😄 Python || C++ || HTML || CSS || JAVASCRIPT
41 | - 🤔 I’m learning REACT || NodeJS || MongoDB
42 | - Connect with Me:
43 | - 📫 LinkedIn
44 | - 💼 Twitter
45 | - 💬 Blogs
46 |
47 |
48 |
49 |
50 | 📊 **This Week I Spent My Time On:**
51 |
52 | ```text
53 | C++ 13 hrs 36 mins ████████████▓░░░░░░░░░░░░ 50.75 %
54 | Javscript 5 hrs 38 mins █████▒░░░░░░░░░░░░░░░░░░░ 21.06 %
55 | Python 4 hrs 29 mins ████▒░░░░░░░░░░░░░░░░░░░░ 16.74 %
56 | React 1 hr 8 mins █░░░░░░░░░░░░░░░░░░░░░░░░ 04.27 %
57 | Golang 45 mins ▓░░░░░░░░░░░░░░░░░░░░░░░░ 02.83 %
58 | ```
59 |
60 |
61 |
--------------------------------------------------------------------------------
/students list/hacktoberfest-2019-master/students list/anjali.md:
--------------------------------------------------------------------------------
1 | ### Anjali Chauhan
2 |
3 |
4 |
5 | 
20 | 
21 | 
22 | 
23 | 
24 | 
25 | 
26 | 
27 | 
28 | 
29 | 
30 | 
31 | 
32 | 
33 | 
34 | 
35 | 
36 | 
37 |
38 |
39 | - 🌱 WEB DEVELOPER || PYTHON DEVELOPER
40 | - 😄 Python || C++ || HTML || CSS || JAVASCRIPT
41 | - 🤔 I’m learning REACT || NodeJS || MongoDB
42 | - Connect with Me:
43 | - 📫 LinkedIn
44 | - 💼 Twitter
45 | - 💬 Blogs
46 |
47 |
48 |
49 |
50 | 📊 **This Week I Spent My Time On:**
51 |
52 | ```text
53 | C++ 13 hrs 36 mins ████████████▓░░░░░░░░░░░░ 50.75 %
54 | Javscript 5 hrs 38 mins █████▒░░░░░░░░░░░░░░░░░░░ 21.06 %
55 | Python 4 hrs 29 mins ████▒░░░░░░░░░░░░░░░░░░░░ 16.74 %
56 | React 1 hr 8 mins █░░░░░░░░░░░░░░░░░░░░░░░░ 04.27 %
57 | Golang 45 mins ▓░░░░░░░░░░░░░░░░░░░░░░░░ 02.83 %
58 | ```
59 |
60 |
61 |
--------------------------------------------------------------------------------
/students list/Ankush_Chauhan.md:
--------------------------------------------------------------------------------
1 | ### Hey there , I'm Ankush
2 |
3 |
24 |
25 |
26 | **Talking about Personal Stuffs:**
27 |
28 | - 👨🏽💻 I’m currently working on something cool :wink: ;
29 | - 🌱 I’m currently learning ReactJS and C++ ;
30 | - 💬 Ask me about anything, I am happy to help ;
31 | - 📫 How to reach me: [Ankush Chauhan](https://www.linkedin.com/ankush-chauhan-590b5b1ab/) ;
32 | - 📝[Resume](https://www.linkedin.com/ankush-chauhan-590b5b1ab/) ;
33 |
34 |
35 |
36 | **Languages and Tools:**
37 |
38 | 
39 | 
40 | 
41 | 
42 | 
43 | 
44 | 
45 | 
46 | 
47 | 
48 | 
49 | 
50 | 
51 | 
52 | 
53 | 
54 | 
55 |
56 |
57 | 📊 **This Week I Spent My Time On:**⏰🕜
58 |
59 | ```text
60 | React 13 hrs 36 mins ████████████▓░░░░░░░░░░░░ 50.75 %
61 | JavaScript 5 hrs 38 mins █████▒░░░░░░░░░░░░░░░░░░░ 21.06 %
62 | CSS 4 hrs 29 mins ████▒░░░░░░░░░░░░░░░░░░░░ 16.74 %
63 | HTML 1 hr 8 mins █░░░░░░░░░░░░░░░░░░░░░░░░ 04.27 %
64 | Python 45 mins ▓░░░░░░░░░░░░░░░░░░░░░░░░ 02.83 %
65 | ```
66 |
67 |
68 |
69 | 💭🌇🗼 **My Dream Companies:** 🌇🗼
70 | 
72 | 
73 | 
74 | 
75 | 
76 | 
77 |
78 |
79 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/students list/hacktoberfest-2019-master/students list/Ankush_Chauhan.md:
--------------------------------------------------------------------------------
1 | ### Hey there , I'm Ankush
2 |
3 |
24 |
25 |
26 | **Talking about Personal Stuffs:**
27 |
28 | - 👨🏽💻 I’m currently working on something cool :wink: ;
29 | - 🌱 I’m currently learning ReactJS and C++ ;
30 | - 💬 Ask me about anything, I am happy to help ;
31 | - 📫 How to reach me: [Ankush Chauhan](https://www.linkedin.com/ankush-chauhan-590b5b1ab/) ;
32 | - 📝[Resume](https://www.linkedin.com/ankush-chauhan-590b5b1ab/) ;
33 |
34 |
35 |
36 | **Languages and Tools:**
37 |
38 | 
39 | 
40 | 
41 | 
42 | 
43 | 
44 | 
45 | 
46 | 
47 | 
48 | 
49 | 
50 | 
51 | 
52 | 
53 | 
54 | 
55 |
56 |
57 | 📊 **This Week I Spent My Time On:**⏰🕜
58 |
59 | ```text
60 | React 13 hrs 36 mins ████████████▓░░░░░░░░░░░░ 50.75 %
61 | JavaScript 5 hrs 38 mins █████▒░░░░░░░░░░░░░░░░░░░ 21.06 %
62 | CSS 4 hrs 29 mins ████▒░░░░░░░░░░░░░░░░░░░░ 16.74 %
63 | HTML 1 hr 8 mins █░░░░░░░░░░░░░░░░░░░░░░░░ 04.27 %
64 | Python 45 mins ▓░░░░░░░░░░░░░░░░░░░░░░░░ 02.83 %
65 | ```
66 |
67 |
68 |
69 | 💭🌇🗼 **My Dream Companies:** 🌇🗼
70 | 
72 | 
73 | 
74 | 
75 | 
76 | 
77 |
78 |
79 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------