< Ace Coding /> πŸš€
337 subscribers
54 photos
2 videos
95 files
66 links
Welcome to Ace Coding! Join us for tips, tutorials, and insights on coding and software engineering. Stay updated with the latest content and elevate your programming skills!Let's learn and grow together in the world of software engineering!
Download Telegram
Forwarded from β™€
5. πŸ” What is the command to compare two values in Assembly language?
Anonymous Quiz
15%
A) CPR
8%
B) CPMR
38%
C) CMPR
38%
D) CMP
Forwarded from β™€
6. πŸ“ What character is used to comment in Assembly
Anonymous Quiz
27%
A) //
20%
B) #
20%
C) ;
33%
D) <!-- -->
Forwarded from β™€
7. πŸ” What is the command to jump to a line in loops (similar to goto in C++)?
Anonymous Quiz
50%
A) JMP
8%
B) JNP
0%
C) JPM
42%
D) JUM
Forwarded from β™€
8. ⚑️ Which operation is faster?
Anonymous Quiz
0%
A) Fetching from ROM
7%
B) Fetching from RAM
93%
C) Fetching from CPU registers
Forwarded from β™€
10. 🧠 If registers are much faster, why can't we use them instead of memory?
Anonymous Quiz
7%
A) CPUs are small in size
79%
B) Registers cannot hold data for longer periods
14%
C) Registers have smaller sizes (16, 32, 64 bits)
πŸŽ‰ How many questions did you ace? πŸ’₯
Let’s see how many of you are ready for the exam! 😎 Drop your score below!
Out of 23 questions, how many did you get right? πŸ€”
Anonymous Poll
25%
πŸ† All of them! (23/23)
25%
😏 Almost there! (20-22)
25%
πŸ’‘ Got a solid score! (15-19)
13%
πŸ”₯ Some tough ones! (10-14)
13%
πŸ˜… Well, I tried! (0-9)
Mosh-cheat-sheets.zip
7.1 MB
πŸš€ Cheat Sheets by Mosh πŸš€

Quick reference for Java, Python, SQL, and Git! πŸ“š

β˜•οΈ Java Cheat Sheet
🐍 Python Cheat Sheet
πŸ“Š SQL Cheat Sheet
πŸ’» Git Cheat Sheet


Stay tuned for more! πŸ”₯
πŸŒŸπŸš€ @AceCoding Presents! πŸš€πŸŒŸ

#Java #Python #SQL #Git #CheatSheet
πŸ‘2
if (10 > 5) 
int sum = 10 + 5;

System.out.println(sum);
What’s wrong with the above snippet of code?
Anonymous Quiz
40%
a. Perfectly fine
14%
b. Sum is not printed
21%
c. Runtime error
24%
d. Compilation error
πŸ”₯4
Predict the output:

    int i = 0;
while (++i < 5);
cout << "i: " << i << endl;
Predict the output:

    int x = 5;
int y = 10;
(x > y ? x : y) = 50;
cout << "x: " << x << ", y: " << y << endl;
Predict the output:

    int a = (3, 4, 1, 2); 
cout << a ;
πŸ“ Types of Errors in a Program: πŸ’₯βš‘οΈπŸ”

πŸ’₯ Compilation Error: (Cannot compile, cannot run)
Occurs when the code has syntax issues, preventing it from being compiled. Common examples include missing semicolons, mismatched parentheses, or undeclared variables.
Example: int x = ;


⚑️ Runtime Error: (Compiles but cannot run, compilation comes before code execution or running)
Happens while the program is running. It usually occurs due to illegal operations like division by zero, accessing invalid memory, or infinite loops.
Example: int x = 5 / 0;


πŸ” Logical Error: (Code compiles and runs but won't result a correct output)
Occurs when the code runs without crashing, but it produces incorrect results due to flawed logic or assumptions. It can be tricky to spot as the program compiles and runs fine.
Example: int a = 5; int b = 2; cout << a - b; (Expecting multiplication but using subtraction)


πŸŒŸπŸš€ @AceCoding Presents! πŸš€πŸŒŸ
πŸ“š Simple Sorting Algorithms implementation in in C++

1. Insertion Sort
void insertion_sort(int arr[], int size) {
int temp, i, j;
for (i = 0; i < size; i++) {
temp = arr[i];
j = i;
while (j > 0 && arr[j-1] > temp) {
arr[j] = arr[j - 1];
j--;
}
arr[j] = temp;
}
}


2. Bubble Sort

void bubble_sort(int arr[], int size) {
for (int i = 0; i < size; i++) {
for (int j = i + 1; j < size; j++) {
if (arr[i] > arr[j]) {
swap(arr[i], arr[j]);
}
}
}
return;
}


βœ… Optimized version of bubble sort, which will give a TC of O(n) best case (array is already sorted)
void bubbleSortOptimized(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
bool swapped = false;
for (int j = 0; j < size - 1 - i; j++) {
if (arr[j] > arr[j + 1]) {
swap(arr[j], arr[j + 1]);
swapped = true;
}
}
if (!swapped) break;
}
}


3. Selection Sort

void selection_sort(int arr[], int size) {
int min_index;
for (int i = 0; i < size; i++) {
min_index = i;
for (int j = i + 1; j < size; j++) {
if (arr[j] < arr[min_index]) {
min_index = j;
}
}
swap(arr[i], arr[min_index;
}
}


βš™οΈ Which Sorting Algorithm is Best?

- Insertion Sort is efficient for small or nearly sorted datasets.
- Bubble Sort is simple but slow for large datasets (O(nΒ²) time complexity).
- Selection Sort is also O(nΒ²) but has a fixed number of swaps.

πŸŒŸπŸš€ @AceCoding Presents! πŸš€πŸŒŸ
Here you can see the trade-offs of different sorting algorithms πŸ“Š

πŸŒŸπŸš€ @AceCoding Presents! πŸš€πŸŒŸ
Forwarded from AASTU Software Engineering (John Robi)
DSA Exams.rar
24.8 MB
Previous DSA exams