This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| public class Iterable_iterator implements Iterable<Integer> { | |
| private List<Integer> myList; | |
| public Iterable_iterator(List<Integer> myList) { | |
| this.myList = myList; | |
| } | |
| @Override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class queue { | |
| class Node { | |
| int data; | |
| Node next; | |
| Node(int data) { | |
| this.data = data; | |
| next = null; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class StackLL { | |
| private class Node { | |
| int data; | |
| Node next; | |
| Node(int data) { | |
| this.data = data; | |
| next = null; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Doublylinkedlist { | |
| Node head; | |
| Node tail; | |
| private int size; | |
| Doublylinkedlist() { | |
| size = 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LL { | |
| Node head; | |
| private int size; | |
| LL () { | |
| size = 0; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <math.h> | |
| #include <time.h> | |
| typedef struct | |
| { | |
| double hi; | |
| double lo; | |
| } two_val; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]) |
NewerOlder