Skip to content

Instantly share code, notes, and snippets.

View NeonWizard's full-sized avatar

Wes NeonWizard

View GitHub Profile

Assignment 4: SkipList

Goals: Working with dynamic arrays, pointers, doubly linked lists

The starter code can be downloaded from https://github.com/ajahanba/342/tree/main/ass4-skiplist-starter-master (Links to an external site.)


For this assignment, you will write a Skip List data structure to store integers. When searching a Skip List, items can be found in O(log n) time. No duplicates are allowed.

A SkipList can have multiple levels. SkipList of depth 1 is similar to a doubly linked list. All elements are inserted into a single doubly linked list.

Kitchen

  • Table / chairs
  • Large fry pan
  • Large saucepan
  • Knives
  • Spatulas
  • Tongs
  • Cutting boards
  • Colander
  • Vegetable peeler

Best practices for godlike code repos

Basics

from http.server import BaseHTTPRequestHandler, HTTPServer
import json
from urllib.parse import parse_qs
import http.cookies as cookies
class Handler(BaseHTTPRequestHandler):
# Add CORS support
def end_headers(self):
self.send_header("Access-Control-Allow-Origin", self.headers["Origin"])
self.send_header("Access-Control-Allow-Headers", "Content-Type, Content-Length")