"Beware of Fake Texts and Delivery Scams During Amazon Prime Day: Tips to Stay Safe"

According to Tompor, scammers are taking advantage of the Amazon Prime Day event, a popular online shopping extravaganza, to trick unsuspecting consumers


7.sorting

selection


#include<stdio.h>
#include<stdint.h>

#define SIZE 10
int i,j;

void selection_sort(int a[])
{
    for(i=0; i<SIZE; i++)
    {
        int min = i;
        for(j=i+1; j<SIZE; j++)
        {
            if(a[j] < a[min] )
                min =j;
        }
        int temp= a[i];
        a[i] = a[min];
        a[min] = temp;
    }
}


void bubble_sort(int a[])
{
    for(i=0; i<SIZE-1; i++)
    {
        for(j=0; j<SIZE-i-1; j++)
        {
            if(a[j] > a[j+1])
            {
                int temp=a[j];
                a[j] = a[j+1];
                a[j+1] = temp;
            }
        }
    }
}


void insertion_sort(int a[])
{
    for(j=1; j<SIZE; j++)
    {
        int k = a[j];
        i=j-1;
        while( i >= 0 && k < a[i])
        {
            a[i+1] = a[i];
            i--;
        }
        a[i+1] = k;
    }
}

void merge(int a[], int low, int mid, int high);

void merge_sort(int a[], int low, int high)
{
    if(low < high)
    {
        int mid = (low + high) / 2;
        merge_sort(a, low, mid);
        merge_sort(a, mid + 1, high);
        merge(a, low, mid, high);
    }
}


void merge(int a[], int low, int mid, int high)
{
    int b[high - low + 1];
    int i = 0, h = low, j = mid + 1, k;

    while(h <= mid && j <= high)
    {
        if(a[h] < a[j])
            b[i++] = a[h++];
        else
            b[i++] = a[j++];
    }

    while(h <= mid)
        b[i++] = a[h++];

    while(j <= high)
        b[i++] = a[j++];

    for(k = 0; k < (high - low + 1); k++)
        a[low + k] = b[k];
}


int partition(int a[], int p, int q)
{
    int pi = a[p];
    int up = p;
    int down = q;

    while(up < down)
    {
        while(a[up] <= pi && up < q)
            up++;
        while(a[down] > pi && down > p)
            down--;
        if(up < down)
        {
            int temp = a[up];
            a[up] = a[down];
            a[down] = temp;
        }
    }
    int temp = a[p];
    a[p] = a[down];
    a[down] = temp;

    return down;
}

void quick_sort(int a[], int p, int q)
{
    if(p < q)
    {
        int j = partition(a, p, q);
        quick_sort(a, p, j-1);
        quick_sort(a, j+1, q);
    }
}


int main()
{
    int a[SIZE] = {20,45,32,67,85,12,24,56,90,16};
    printf("before sorting\n");
    for(i=0; i<SIZE; i++)
    {
        printf("%d\t",a[i] );
    }

    /*
    selection_sort(a);
    printf("\nafter using selection sort\n");
    for(i=0; i<SIZE; i++)
    {
        printf("%d\t",a[i] );
    }
    */

    /*
    bubble_sort(a);
    printf("\nafter using bubble sort\n");
    for(i=0; i<SIZE; i++)
    {
        printf("%d\t",a[i] );
    }
    */

    /*
    insertion_sort(a);
    printf("\nafter using insertion sort\n");
    for(i=0; i<SIZE; i++)
    {
        printf("%d\t",a[i] );
    }
    */

    /*
    merge_sort(a, 0, SIZE-1);
    printf("\nafter using merge sort\n");
    for(i=0; i<SIZE; i++)
    {
        printf("%d\t",a[i] );
    }
    */


    /*
    quick_sort(a, 0, SIZE-1);
    printf("\nafter using quick sort\n");
    for(i=0; i<SIZE; i++)
    {
        printf("%d\t",a[i] );
    }
    */

}



L based QUEUE

L QUEUE header


#ifndef QUEUE_H
#define QUEUE_H

#include <stdbool.h>

// Node structure for linked list
typedef struct Node {
    int data;
    struct Node* next;
} Node;

// Queue structure
typedef struct Queue {
    Node* front;
    Node* rear;
    int size;
} Queue;

// Function interfaces
Queue* createQueue();
void enqueue(Queue* q, int data);
int dequeue(Queue* q);
int peek(Queue* q);
bool isEmpty(Queue* q);
int getSize(Queue* q);
void displayQueue(Queue* q);
void destroyQueue(Queue* q);

#endif



L QUEUE main

#include <stdio.h>
#include "queue.h"

int main()
{
    printf("=== Simple Queue Test ===\n\n");
    
    // Create queue
    Queue* q = createQueue();
    
    // Enqueue some values
    printf("Enqueuing values: 10, 20, 30, 40\n");
    enqueue(q, 10);
    enqueue(q, 20);
    enqueue(q, 30);
    enqueue(q, 40);
    
    // Display queue
    displayQueue(q);
    printf("Queue size: %d\n\n", getSize(q));
    
    // Peek at front
    printf("Front element (peek): %d\n\n", peek(q));
    
    // Dequeue elements
    printf("Dequeuing elements:\n");
    printf("Dequeued: %d\n", dequeue(q));
    printf("Dequeued: %d\n", dequeue(q));
    
    // Display queue after dequeue
    printf("\nAfter dequeuing:\n");
    displayQueue(q);
    printf("Queue size: %d\n\n", getSize(q));
    
    // Check if empty
    printf("Is queue empty? %s\n\n", isEmpty(q) ? "Yes" : "No");
    
    // Dequeue remaining
    printf("Dequeuing remaining elements:\n");
    while (!isEmpty(q)) {
        printf("Dequeued: %d\n", dequeue(q));
    }
    
    // Try to dequeue from empty queue
    printf("\nTrying to dequeue from empty queue:\n");
    dequeue(q);
    
    // Check if empty
    printf("Is queue empty? %s\n", isEmpty(q) ? "Yes" : "No");
    
    // Clean up
    destroyQueue(q);
    
    printf("\nTest completed!\n");
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include "queue.h"

// Create a new queue
Queue* createQueue() {
    Queue* q = (Queue*)malloc(sizeof(Queue));
    if (q == NULL) {
        printf("Memory allocation failed\n");
        exit(1);
    }
    q->front = NULL;
    q->rear = NULL;
    q->size = 0;
    return q;
}

// Add element to the rear of queue
void enqueue(Queue* q, int data) {
    if (q == NULL) return;
    
    Node* newNode = (Node*)malloc(sizeof(Node));
    if (newNode == NULL) {
        printf("Memory allocation failed\n");
        return;
    }
    
    newNode->data = data;
    newNode->next = NULL;
    
    if (q->rear == NULL) {
        q->front = q->rear = newNode;
    } else {
        q->rear->next = newNode;
        q->rear = newNode;
    }
    q->size++;
}

// Remove element from front of queue
int dequeue(Queue* q) {
    if (q == NULL || q->front == NULL) {
        printf("Queue is empty\n");
        return -1;
    }
    
    Node* temp = q->front;
    int data = temp->data;
    
    q->front = q->front->next;
    
    if (q->front == NULL) {
        q->rear = NULL;
    }
    
    free(temp);
    q->size--;
    return data;
}

// Get front element without removing
int peek(Queue* q) {
    if (q == NULL || q->front == NULL) {
        printf("Queue is empty\n");
        return -1;
    }
    return q->front->data;
}

// Check if queue is empty
bool isEmpty(Queue* q) {
    return (q == NULL || q->front == NULL);
}

// Get size of queue
int getSize(Queue* q) {
    if (q == NULL) return 0;
    return q->size;
}

// Display queue elements
void displayQueue(Queue* q) {
    if (q == NULL || q->front == NULL) {
        printf("Queue is empty\n");
        return;
    }
    
    printf("Queue: ");
    Node* current = q->front;
    while (current != NULL) {
        printf("%d ", current->data);
        current = current->next;
    }
    printf("\n");
}

// Destroy queue and free memory
void destroyQueue(Queue* q) {
    if (q == NULL) return;
    
    Node* current = q->front;
    while (current != NULL) {
        Node* temp = current;
        current = current->next;
        free(temp);
    }
    free(q);
}


L QUEUE OP



#include <stdio.h>
#include <stdlib.h>
#include "queue.h"

// Create a new queue
Queue* createQueue() {
    Queue* q = (Queue*)malloc(sizeof(Queue));
    if (q == NULL) {
        printf("Memory allocation failed\n");
        exit(1);
    }
    q->front = NULL;
    q->rear = NULL;
    q->size = 0;
    return q;
}

// Add element to the rear of queue
void enqueue(Queue* q, int data) {
    if (q == NULL) return;
    
    Node* newNode = (Node*)malloc(sizeof(Node));
    if (newNode == NULL) {
        printf("Memory allocation failed\n");
        return;
    }
    
    newNode->data = data;
    newNode->next = NULL;
    
    if (q->rear == NULL) {
        q->front = q->rear = newNode;
    } else {
        q->rear->next = newNode;
        q->rear = newNode;
    }
    q->size++;
}

// Remove element from front of queue
int dequeue(Queue* q) {
    if (q == NULL || q->front == NULL) {
        printf("Queue is empty\n");
        return -1;
    }
    
    Node* temp = q->front;
    int data = temp->data;
    
    q->front = q->front->next;
    
    if (q->front == NULL) {
        q->rear = NULL;
    }
    
    free(temp);
    q->size--;
    return data;
}

// Get front element without removing
int peek(Queue* q) {
    if (q == NULL || q->front == NULL) {
        printf("Queue is empty\n");
        return -1;
    }
    return q->front->data;
}

// Check if queue is empty
bool isEmpty(Queue* q) {
    return (q == NULL || q->front == NULL);
}

// Get size of queue
int getSize(Queue* q) {
    if (q == NULL) return 0;
    return q->size;
}

// Display queue elements
void displayQueue(Queue* q) {
    if (q == NULL || q->front == NULL) {
        printf("Queue is empty\n");
        return;
    }
    
    printf("Queue: ");
    Node* current = q->front;
    while (current != NULL) {
        printf("%d ", current->data);
        current = current->next;
    }
    printf("\n");
}

// Destroy queue and free memory
void destroyQueue(Queue* q) {
    if (q == NULL) return;
    
    Node* current = q->front;
    while (current != NULL) {
        Node* temp = current;
        current = current->next;
        free(temp);
    }
    free(q);
}



L based Stack

Lstack header

#ifndef _INCLUDED_STACK_H_
#define _INCLUDED_STACK_H_
#include <stdint.h>

#define MAX_DEPTH 30
#define RESULT_INVALID 0
#define STACK_OK 1
#define STACK_FULL 2
#define STACK_EMPTY 3

struct _stack_node_
{
    float data;
    struct _stack_node_ *next;
};

typedef struct _stack_node_ StackNode;

struct _stack_
{
    uint32_t size;      // Maximum capacity
    uint32_t count;     // Current number of elements
    StackNode *top;     // Pointer to top node
};

typedef struct _stack_ Stack;

struct _stack_result_
{
    float data;
    uint32_t status;
}; 

typedef struct _stack_result_ StackResult;

Stack stack_new(uint32_t size);
uint32_t stack_full(const Stack *stk);
uint32_t stack_empty(const Stack *stk);
Stack* stack_push(Stack *stk, float data, StackResult *result);
Stack* stack_pop(Stack *stk, StackResult *result);
Stack* stack_peek(Stack *stk, StackResult *result);
void stack_destroy(Stack *stk);  // New function to free memory

#endif

LStack main


#include <stdio.h>
#include "stack.h"

int main()
{
    Stack stk = stack_new(5);
    StackResult result;
    
    printf("=== Simple Stack Test ===\n\n");
    
    // Push some values
    printf("Pushing values: 10, 20, 30\n");
    stack_push(&stk, 10.0, &result);
    stack_push(&stk, 20.0, &result);
    stack_push(&stk, 30.0, &result);
    
    // Peek at top
    printf("\nPeek at top: ");
    stack_peek(&stk, &result);
    if (result.status == STACK_OK)
        printf("%.1f\n", result.data);
    
    // Pop all values
    printf("\nPopping values:\n");
    while (!stack_empty(&stk))
    {
        stack_pop(&stk, &result);
        if (result.status == STACK_OK)
            printf("Popped: %.1f\n", result.data);
    }
    
    // Try to pop from empty stack
    printf("\nTrying to pop from empty stack:\n");
    stack_pop(&stk, &result);
    if (result.status == STACK_EMPTY)
        printf("Stack is empty!\n");
    
    // Clean up
    stack_destroy(&stk);
    
    printf("\nTest completed!\n");
    return 0;
}


LStack op

#include <assert.h>
#include <stddef.h>
#include <stdlib.h>
#include "stack.h"

Stack stack_new(uint32_t size)
{
    size = (size > 0 && size < MAX_DEPTH) ? size : MAX_DEPTH;
    Stack s = {size, 0, NULL};
    return s;
}

uint32_t stack_full(const Stack *stk)
{
    assert(stk != NULL);
    return (stk->count == stk->size);
}

uint32_t stack_empty(const Stack *stk)
{
    assert(stk != NULL);
    return (stk->top == NULL);
}

Stack* stack_push(Stack *stk, float data, StackResult *result)
{
    assert(stk != NULL);
    
    if (stk->count < stk->size)
    {
        StackNode *new_node = (StackNode*)malloc(sizeof(StackNode));
        if (new_node == NULL)
        {
            result->data = data;
            result->status = RESULT_INVALID;
            return stk;
        }
        
        new_node->data = data;
        new_node->next = stk->top;
        stk->top = new_node;
        stk->count++;
        
        result->data = data;
        result->status = STACK_OK;
    }
    else
    {
        result->data = data;
        result->status = STACK_FULL;
    }
    return stk;
}

Stack* stack_pop(Stack *stk, StackResult *result)
{
    assert(stk != NULL);
    
    if (stk->top != NULL)
    {
        StackNode *temp = stk->top;
        result->data = temp->data;
        result->status = STACK_OK;
        
        stk->top = stk->top->next;
        stk->count--;
        free(temp);
    }
    else
    {
        result->status = STACK_EMPTY;
    }
    return stk;
}

Stack* stack_peek(Stack *stk, StackResult *result)
{
    assert(stk != NULL);
    
    if (stk->top != NULL)
    {
        result->data = stk->top->data;
        result->status = STACK_OK;
    }
    else
    {
        result->status = STACK_EMPTY;
    }
    return stk;
}

void stack_destroy(Stack *stk)
{
    assert(stk != NULL);
    
    StackNode *current = stk->top;
    while (current != NULL)
    {
        StackNode *temp = current;
        current = current->next;
        free(temp);
    }
    stk->top = NULL;
    stk->count = 0;
}


According to Tompor, scammers are taking advantage of the Amazon Prime Day event, a popular online shopping extravaganza, to trick unsuspecting consumers. They send fake text messages posing as delivery notifications, claiming that a package couldn't be delivered due to an incorrect address or unpaid shipping fees. These texts often include malicious links or phone numbers, aiming to deceive recipients into providing personal information or making payments.

Amazon Prime Day

The author emphasizes the importance of verifying the legitimacy of any text message or notification received, especially during high-profile shopping events like Prime Day. Tompor advises recipients to independently track their orders on the official retailer's website or app instead of clicking on suspicious links. By doing so, consumers can ensure the accuracy of delivery information and avoid falling into the trap of scammers.

Tompor further recommends contacting the retailer directly if there are any concerns or doubts about a delivery notification. It is crucial to use contact information obtained from official sources rather than relying on the information provided in suspicious text messages. Retailers can verify the status of an order and provide guidance on how to proceed if there are any genuine issues with the delivery.

Furthermore, the additional tips to protect oneself from scams. One suggestion is to enable two-factor authentication for online shopping accounts, adding an extra layer of security. Reviewing credit card statements regularly can help identify any unauthorized transactions and take immediate action if necessary. Additionally, consumers should be cautious of unexpected requests for personal information or payments, as scammers often use urgency and fear tactics to pressure victims into providing sensitive data.

In conclusion, the readers to stay vigilant during Amazon Prime Day and other online shopping events to avoid falling victim to fake text messages and delivery scams. By staying cautious, verifying notifications, and taking necessary precautions, consumers can protect themselves from potential fraudulent activities. It is essential to rely on official retailer channels, independently track orders, and avoid clicking on suspicious links or sharing personal information. By following these guidelines, shoppers can have a safe and secure online shopping experience.





Post a Comment

0 Comments