Code Monkey home page Code Monkey logo

java-practice's Introduction

Java Code Practice

Repository to practice Java code Heavily inspired by https://github.com/jwasham/coding-interview-university

Arrays

https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html

  • Implement an Array List with the following methods:
    • isEmpty() - return true if the list is empty
    • size() - return the number of elements in the list
    • capacity() - return the capacity of the list
    • add(element) - add an element to the end of the list
    • remove(index) - remove an element at the given index
    • get(index) - return the element at the given index
    • set(element, index) - replace an element at the given index

Linked Lists

https://docs.oracle.com/javase/7/docs/api/java/util/LinkedList.html

  • Implement a Doubly Linked List with the following methods:
    • isEmpty() - return true if the list is empty
    • size() - return the number of elements in the list
    • add(element, index) - add an element at the specified index
    • addFirst(element) - add an element at the beginning of the list
    • addLast(element) - add an element at the end of the list
    • remove(index) - remove an element at the specified index
    • removeFirst() - remove the first element in the list
    • removeLast() - remove the last element in the list
    • getFirst() - return the first element in the list
    • getLast() - return the last element in the list
    • get(index) - return the element at the given index
    • set(element, index) - replace an element at the given index

Data Structures practice problems

Taken from UC San Diego Coursera course

  • Check brackets in code [Stack]
  • Extending stack interface [Stack]
  • Network packet processing [Queue]
  • Maximum sliding window [Stack/Queue]
  • Compute tree height [Tree]

java-practice's People

Contributors

tony9984 avatar tonyoucarbon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.