Skip to content

Instantly share code, notes, and snippets.

@AhmedMaad
AhmedMaad / Main.kt
Created January 10, 2024 15:23
How to implement the search functionality in a Kotlin program that has a data source of some array elements
fun main(args: Array<String>) {
val searchElements = arrayOf(
"Android Upside down cake",
"function",
"class",
"object",
"inheritance",
"polymorphism",
"loop",
@AhmedMaad
AhmedMaad / main.cpp
Created December 18, 2022 23:12
Super Market Stack with Queue using LinkedList
#include <iostream>
using namespace std;
/*
Inside a supermarket, there was a queue of customers at the cashier (4 customers),
named "1,2,3, and 4" The first customer paid for her products and then left the market,
after that a VIP customer named "5" entered the shop and he will pay for his products before customers "2,3, and 4".
Implement this scenario using Stack with Queue using LinkedList , and then print the final queue.
*/
@AhmedMaad
AhmedMaad / main.cpp
Last active November 13, 2022 13:12
#include <iostream>
using namespace std;
struct node{
int data;
node *next;
};
void display(node** head){
node * temp = *head;
@AhmedMaad
AhmedMaad / MainActivity.java
Created September 19, 2020 12:07
Android Java code for calling a number without the need to open the dialer before calling to make a faster process in emergency apps.
//TODO: Add your package name here (e.g. com.maad.candroid)
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;