background preloader


Facebook Twitter

All my notes on Algorithms

Problems. 4.5 Discussion and Exercises. Java Algorithms and Clients. Top 10 Algorithms for Coding Interview. PDF: Update History, Latest version (8/1/2016) The following are the common subjects in coding interviews.

Top 10 Algorithms for Coding Interview

As understanding those concepts requires much more effort, this tutorial only serves as an introduction. The subjects that are covered include: 1) String/Array/Matrix, 2) Linked List, 3) Tree, 4) Heap, 5) Graph, 6) Sorting, 7) Dynamic Programming, 8) Bit Manipulation, 9) Combinations and Permutations, and 10) Math Problems. I highly recommend you to read "Simple Java" first, if you need a brief review of Java basics. If you want to see code examples that show how to use a popular API, you can use 1.

An algorithm problem's input is often a string or array. 2. Common methods to solve matrix related problem include DFS, BFS, dynamic programming, etc. 3. The implementation of a linked list is pretty simple in Java. Two popular applications of linked list are stack and queue. Data Structure Visualization. Linked List Queue Visualization. A personal view of the theory of computation. Jeff Erickson's Algorithms. This page contains lecture notes and other course materials for various algorithms classes I have taught at the University of Illinois, Urbana-Champaign.

Jeff Erickson's Algorithms

The notes are numbered in the order I cover the material in a typical undergraduate class, wtih notes on more advanced material (indicated by the symbol ♥) intersprsed appropriately. New Jan 2015: In addition to the algorithms notes I have been maintaining since 1999, this page also contains new notes on "Models of Computation", which cover a small subset of the material normally taught in undergraduate courses in formal languages and automata. I wrote these notes for a new junior-level course on "Algorithms and Models of Computation" that Lenny Pitt and I developed, which is now required for all undergraduate computer science and computer engineering majors at UIUC.

You can see this material in context at my Fall 2014 course web site. Feedback is always welcome, especially bug reports. Everything. Neopythonic. Lectures 1 and 2: Analysis of Algorithms. I just finished watching the last lecture of MIT's "Introduction to Algorithms" course.

Lectures 1 and 2: Analysis of Algorithms

Having a great passion for all aspects of computing, I decided to share everything I learned with you, my dear readers! This is the first post in an article series about this course. As I wrote earlier, I am very serious about watching video lectures. If they are math-intensive, I usually take notes as if I were in the classroom. Lectures in this course were exactly like that -- logarithms, big-o's, thetas, expectations, and all the other math guys fighting with each other on the blackboards. Calculate the sum of long numbers - James Chen's C/C++ Home. Reverse a linked list in java « Think ! If you search for it you will get millions of solutions but sadly (like many things in internet) the first few solutions seem unintuitive and unnecessarily complex for such a simple problem, not sure why, anyway putting mine out there for somebody to point out why I should go for a more complex solution.

Reverse a linked list in java « Think !

[in java for a change] Idea : Use two references and reverse their links and proceed till we reach the end public void reverse_iterative { if(isEmpty()) { return;} //curr == null Node currNode,nextNode , loopNode; currNode = head; nextNode =; = null; while(nextNode ! Vkostyukov/finagle-fibonacci. Sorting Algorithm Animations. CS 240 Computer Science II Syllabus. Spring 2008 SYLLABUS This page last changed 6/19/08 Objectives: To develop skills in the design and development of computer software continuing to utilize an object-oriented language, packages, modules and libraries.

CS 240 Computer Science II Syllabus

To develop understanding and build skills in the implementation and use of common data structures used in software development through data abstraction. To further study the Java language and learn to use UNIX as a software design environment. This course's prerequisite is CS 110. Build program solutions using control structures of selection (if-then, switch), iteration (while, for) and functions understand the use of objects, methods, and classes understand the basic use of vectors (arrays) understand the design, implementation and testing of small problem solutions (25-50 lines of code) Open Data Structures (in Java)

Dictionary of Algorithms and Data Structures. CPSC490 - Problem Solving in Computer Science. Sphere Online Judge (SPOJ) - Problems. Algorithm Tutorials. Big-O Algorithm Complexity Cheat Sheet. Adnan Aziz. Elements of Programming Interviews We're excited to release a free soft copy sampler of EPI.

Adnan Aziz

Specifically, this PDF shows the organization, content, style, topics, and quality of our book. Maratona/Facebook at master · arthurguima/maratona. / - elements-of-programming-interviews - Solutions to Elements of Programming Interviews: 300 Questions and Solutions. Markov Chains – Explained. Markov Chains is a probabilistic process, that relies on the current state to predict the next state.

Markov Chains – Explained

For Markov chains to be effective the current state has to be dependent on the previous state in some way; For instance, from experience we know that if it looks cloudy outside, the next state we expect is rain. We can also say that when the rain starts to subside into cloudiness, the next state will most likely be sunny.

Not every process has the Markov Property, such as the Lottery, this weeks winning numbers have no dependence to the previous weeks winning numbers. Usually when we have data, we calculate the probability of a state by counting the amount of times it occurs within a total of all states, we then end up with 0.5(50%) cloudy, 0.3(30%) rain, 0.2(20%) Sunny days of a year; Containing no information about when they occur relating to each other. The Transition Matrix transitions from Row to Column as in the Markov Table. Scalgorithms - Algorithms and Data-Structures in Scala.

Efficient binary tree traversal with two pointers without using a stack - debforit. In this article, we will be discussing about space complexity optimized binary tree traversal techniques.

Efficient binary tree traversal with two pointers without using a stack - debforit

Four modes of traversals are used quite often in a binary tree. They are pre-order walk, in-order walk, post-order walk and level first walk. Except the level first traversal, all the others are recursive and hence require a stack for traversal. We would talk here about in-order traversal. Our analysis can be applied to the other two traversal procedures as well. 52233 Algorithms and Data Structures. Introduction to Programming in Java: An Interdisciplinary Approach. Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne. Lecture Slides for An Introduction to the Analysis of Algorithms. These slides are for the first half of an undergraduate course taught at Princeton, developed to provide an overview of An Introduction to the Analysis of Algorithms and Analytic Combinatorics.

Lecture Slides for An Introduction to the Analysis of Algorithms

The course format is "introduce-read-discuss". We introduce a set of topics in lecture; students read about the topics and work selected exercises between lectures, and we discuss any questions about the reading and the exercises at the beginning of the next lecture. Each lecture ends with a slide or two giving assignments to be completed before the next lecture and to be discussed at the beginning of the next lecture.

In addition, a portion of each lecture is devoted to in-class exercises, to make sure that all students understand the introductory material. While some of the reading material may be difficult for a typical undergraduate to master on such a quick pass through, a substantial fraction of the coverage is elementary. What not to do during an interview. CSE101. Stanford / Computer Science III: Programming Paradigms , Academic Earth. Algorithms. Data Structures and Algorithm. A computer science portal for geeks. Sorting Applications. Sorting algorithms and priority queues are widely used in a broad variety of applications.

Sorting Applications

Our purpose in this section is to briefly survey some of these applications. Sorting various types of data. Our implementations sort arrays of Comparable objects. This Java convention allows us to use Java's callback mechanism to sort arrays of objects of any type that implements the Comparable interface. Transaction example. Which sorting algorithm should I use? Knowing which algorithm is best possible depends heavily on details of the application and implementation, but we have studied some general-purpose methods that can be nearly as effective as the best possible for a wide variety of applications.

Property. In most practical situations, quicksort is the method of choice. Sorting primitive types. Jdk8/jdk8/jdk: 687fd7c7986d src/share/classes/java/util/