Skip to content

Instantly share code, notes, and snippets.

View Rohit-554's full-sized avatar
🎯
Focusing

Jadu Rohit-554

🎯
Focusing
View GitHub Profile
@Rohit-554
Rohit-554 / iterable_iterator.java
Created March 25, 2023 18:35
iterator_Iterator
import java.util.*;
public class Iterable_iterator implements Iterable<Integer> {
private List<Integer> myList;
public Iterable_iterator(List<Integer> myList) {
this.myList = myList;
}
@Override
@Rohit-554
Rohit-554 / queue.java
Created March 24, 2023 10:43
Queue Implementation using Linked List
public class queue {
class Node {
int data;
Node next;
Node(int data) {
this.data = data;
next = null;
}
}
@Rohit-554
Rohit-554 / stackLL.java
Created March 24, 2023 10:39
StackusingLinkedList
public class StackLL {
private class Node {
int data;
Node next;
Node(int data) {
this.data = data;
next = null;
}
}
@Rohit-554
Rohit-554 / DoublyLinkedList.java
Created March 23, 2023 10:35
DoublyLinkedLIstImplementation
class Doublylinkedlist {
Node head;
Node tail;
private int size;
Doublylinkedlist() {
size = 0;
}
@Rohit-554
Rohit-554 / LL.java
Created March 23, 2023 10:24
LinkedListImplementationJava
class LL {
Node head;
private int size;
LL () {
size = 0;
}
@Rohit-554
Rohit-554 / Reversebitmap.kt
Created March 14, 2023 13:50
ReverseFunction
fun reverseDistortImage(distortedBitmap: Bitmap, originalBitmap: Bitmap): Bitmap {
val width = distortedBitmap.width
val height = distortedBitmap.height
val reversedBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)
val distortionFactor = 0.02f // Adjust the distortion factor as needed
val xDistortion = (width * distortionFactor).toInt()
val yDistortion = (height * distortionFactor).toInt()
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
typedef struct
{
double hi;
double lo;
} two_val;
fun rb(bitmap: Bitmap): Bitmap {
val width = bitmap.width
val height = bitmap.height
val pixels = IntArray(width * height)
bitmap.getPixels(pixels, 0, width, 0, 0, width, height)
val grayPixels = IntArray(pixels.size)
// Convert the image to grayscale
for (i in pixels.indices) {
val r = Color.red(pixels[i])