Data Structures: Algorithms for Points, Strings, and Compression

Given points in a plane, we can construct a geometric graph. Its vertices correspond to the points, and each edge has a weight equal to the distance between its endpoints. (We might have all “n choose 2” possible edges, or maybe a sparser subset of edges.)

  • The EMST (Euclidean Minimum Spanning Tree): Given n points in the plane, find the lightest possible spanning tree made up of such edges.

We go over the definition (saying which edges are present), and also see a demo here: share/0326/delaunay/

  • An
Read More

Comprehensive Data Structures and Algorithms in C

1. Binary Search

Binary Search Using Recursion

#include <stdio.h>
int binser(int [], int low, int high, int key); // declaration
int main() {
    int n;
    printf("Enter array size: ");
    scanf("%d", &n);
    int arr[n];
    printf("Enter array in sorted order:\n");
    for(int i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
    }
    int key;
    printf("Enter element to search: ");
    scanf("%d", &key);
    int found = binser(arr, 0, n - 1, key);
    if(found == -1) {
Read More