Skip to content

Instantly share code, notes, and snippets.

View kkadapa's full-sized avatar
🛺
Working from home

Karthik kkadapa

🛺
Working from home
View GitHub Profile
@kkadapa
kkadapa / OnlineShopping.py
Created October 22, 2023 02:16
Python program that demonstrates various programming concepts. This program simulates a basic online shopping system. It allows users to add items to their cart, view the cart, and calculate the total cost. This program demonstrates the use of classes, objects, methods, loops, conditional statements, and user input processing. It allows users to…
class Product:
def __init__(self, name, price):
self.name = name
self.price = price
class ShoppingCart:
def __init__(self):
self.items = []
def add_item(self, product, quantity=1):
@kkadapa
kkadapa / gist:fa09807e2e27af75adcbe4f481931ad3
Created June 13, 2021 12:33
PhoneNumber Detector WebView
import WebKit
import PDFKit
import UIKit
class AlertWebViewController : UIViewController, WKUIDelegate, WKNavigationDelegate {
@IBOutlet var alertWebView: WKWebView!
var alertAttachURL = ""
var isDocPDF = false
@kkadapa
kkadapa / main.dart
Created June 1, 2021 13:46
Flutter WebView
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:url_launcher/url_launcher.dart';
import 'dart:async';
void main() => runApp(MaterialApp(home: WikipediaExplorer()));
class WikipediaExplorer extends StatefulWidget {
@override
_WikipediaExplorerState createState() => _WikipediaExplorerState();
@kkadapa
kkadapa / The Technical Interview Cheat Sheet.md
Created January 28, 2016 03:04 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
package com.sorting.algos;
public class MergModify {
/*
* This function sorts the input array and returns the number of inversions
* in the array
*/
static void mergeSort(int arr[], int array_size) {
int temp[] = new int[arr.length];
package com.datastructures;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
public class LinkedList {
private Node head;
package com.datastructures;
public class QueueADT {
private int size = 10;
private int[] arr = new int[size];
private int front = -1;
private int rear = -1;
public boolean isEmpty() {
package com.datastructures;
public class StackADT {
private int size = 10;
private int[] arr = new int[size];
private int top = -1;
public void push(int x) {