A stack is LIFO (Last-In First Out) structure. In contrast, a queue is a FIFO (First-In First-Out ) structure. In a FIFO data structure, the first element added to the queue will be the first one to be removed. This is equivalent to the requirement that once a new element is added, all elements that [...]
Binary Search Trees (BSTs) are an important data structure for dynamic sets. Binary trees offer short paths from root. A node has up to two children that is why it is called binary tree. Data in binary tree is organized by value. A node in binary tree has following elements: A key (value) an identifying field inducing a total ordering; left pointer to a left child (may be NULL); right pointer to a right child (may be NULL); p pointer to a parent node (NULL for root).
Bucket sort (bin sort) is categorized into linear time sorting algorithms. In bucket sort, no comparisons needed between elements. But it depends on assumption about the numbers being sorted.
Bucket sort takes input as n real numbers in the range of 0 and 1. Basic idea of bucket sort is that it create n linked [...]
Quick sort is one of the fastest sorting algorithms known. It sorts O(n log n) in the average case while sorts O(n2) in the worst case. But in practice, it’s quick because the worst case doesn’t happen often. This based on divide-and-conquer strategy. It takes an array A that is to be sorted. The array [...]
A heap can be seen as a complete binary tree. You can think of unfilled (black nodes as given in image below) slots as null pointers.Heaps also satisfy the heap property:
A[Parent(i)] > A[i] for all nodes i > 1
Heaps can also be represented as an array. To represent a complete binary tree as [...]
One of the most basic and powerful algorithmic techniques is Divide and Conquer. For example, the binary search algorithm, which I’ll describe in the context of guess a number game between 1 and 100. Suppose someone picks a number between 1 and 100, and allows you to ask questions of the form “Is the number [...]
Dijkstra’s algorithm was conceived by Dutch computer scientist Edsger Dijkstra in 1956 and published in 1959. It is a graph search algorithm that solves the single-source shortest path problem for a graph with non-negative edge path costs, producing a shortest path tree. This algorithm is often used in routing and as a subroutine in other [...]
Dijkstra algorithm is a graph search algorithm that solves the problem of finding the shortest path from a point in a graph to a destination. It turns out that one can find the shortest paths from a given source to all points in a graph at the same time, hence this problem is sometimes called [...]
by Dave Shreiner
OpenGL is a software interface to graphics hardware. This interface consists of about 150 distinct commands that you use to specify the objects and operations needed to produce interactive three-dimensional applications. This book allows you to create interactive programs that produce color images of moving three-dimensional objects, you can control computer-graphics technology [...]
Most of the programs discussed so far are generally structured as functions call one another in a disciplined, hierarchical manner. In some cases, it is useful to have functions call itself. A function that call itself directly or indirectly (through another function) is a recursive function.
Sometimes it is simpler to implement a repeated operation using recursion [...]
Popular Posts (last 30 days)
- Attendance Management System 1513 view(s)
- Advanced Java Tutorial (For Intermediate) 753 view(s)
- JAVA Graphical User Interface (GUI) 676 view(s)
- Graph Implementation in C++ 514 view(s)
- File Handling using Input-Output Streams in Java 430 view(s)
- Linked lists in C++ 400 view(s)
- Sockets and Network Programming in Java 350 view(s)
- UDP Datagram Sockets in Java 337 view(s)
- Applications of Stack in data structures 328 view(s)
- Circular Linked Lists 310 view(s)
